Update does not work...but no errors either
| From: | Ryan S | Date: | Sat, 31 May 2008 08:23:52 +0000 |
| Subject: | Update does not work...but no errors either | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-274891@lists.php.net to get a copy of this message | ||
Hey,
This is my code:
==============================================================
$update_sql="update greetings_final set
heading='$heading',message='$message',signature='$signature',font_size='$font_size',font_color='$font_color',bg_color='$bg_color'
where temp_cno='".$thecno."' and
rand_string='".$randreference."' LIMIT 5";
echo $update_sql."<br><br>";
$result2 = mysql_query($update_sql);
if(mysql_affected_rows()==0){echo "Error R093d: unable to update greeting";exit;}
==============================================================
As you can see above, i have a echo to show me the exact SQL being run
and also a mysql_affected_rows check to spit out an error if no rows get updated
but for some reason.... no rows are getting updated but mysql is not echoing that error message plus
the sql is running perfectly if i copy and paste it from the echo into phpmyadmin
any ideas?
Thanks!
R