k....heres my code
Code: Select all
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$conn = mysql_connect("somehost","someuser","andthepassword") or die(mysql_error());
mysql_select_db("customerdirectory",$conn) or die(mysql_error());
$next_program = "added.php";
$sql = "INSERT INTO merchant values('$_POST[merchant_num]',
'$_POST[date_recieved]',
'$_POST[merchant_name]',
'$_POST[purchase_type]',
'$_POST[lease_score]',
'$_POST[amex]',
'$_POST[app_id]',
'$_POST[discover]',
'$_POST[user_name]',
'$_POST[check_conversion]',
'$_POST[gift_loyalty]',
'$_POST[app_type]',
'$_POST[terminal]',
'$_POST[serial_num]',
'$_POST[nms]',
'$_POST[ckmerchant_num]',
'$_POST[giftmerchant_num]',
'$_POST[comments]')";
$sql = "SELECT merchant_num FROM merchant WHERE merchant_num = '{$_POST[merchant_num]}'";
if ($merchant_num == ($conn,'{$_POST[merchant_num]}'))//this is line 29
{
echo "The merchant number $merchant_num has already been entered into the database please check merchant and try again";
}
if(mysql_query($sql, $conn))
{
header("Location: $next_program");
}
else
{
echo "something went wrong";
}
?>
now ive done something similar in my login script...but i cant figure out a way to rewrite it for this instance
like you said, i think that i would need to use
then perhaps do something like
Code: Select all
$result2 = mysqli_query($cxn,$sql)
or die("Couldn't execute query 2.");
$row = mysqli_fetch_assoc($result2);
but as far as what to do next im at a lost

especially with this parse....i cant see where in the heck its comming from and until its fixed it it wont let me see if anything else works
