Hello,
I have a strange occurence when trying to execute the following sql:
if($select_232 == 'Member Credit' && $paymenttype == 'Visa' || $paymenttype == 'Cash' || $paymenttype == 'Check' || $paymenttype == 'Master Card' || $paymenttype == 'Discover' || $paymenttype == 'Amex' || $paymenttype == 'Other')
{
$result = mysql_query("UPDATE player_credit SET credit_amount='$new_creditbal', credit='yes', total_credit_value='$new_creditvalue', date_of_credit=CONCAT('$dateinserts', date_of_credit), credit_purpose='$credit_purpose2', typeofcredit='$paymenttype', details = CONCAT('testing', details) WHERE playerid='$playerid'") or die(mysql_error());
$message= 'Updated successfully!';
if (mysql_affected_rows() == 0) {
$result = mysql_query("INSERT player_credit (id, playerid, total_credit_value, credit_amount, date_of_credit, credit_purpose, details, typeofcredit, credit) VALUES('', '$playerid', '$new_creditvalue', '$paymentamount', '$theDate', '$credit_purpose2', '$paymentref_credit2', '$paymenttype', 'yes')") or die(mysql_error());
$message= 'Inserted successfully!';
}
}
The above code works fine if it is in a separate file but when incorporated inside a file with other sqls, only the update statment works. I have for the past few days trying to identify the problem with no success.
Any thoughts!
Mossa