Page 1 of 1

Insane!

Posted: Wed Mar 25, 2009 2:06 pm
by spacebiscuit
Hi guys,

This just does not make sense.

Here is my PHP code:

Code: Select all

$query_update="UPDATE $_POST[table] SET image_filename='$image_filename' WHERE id=$_POST[id]";
 
if($result=mysql_query($query_update)){
      echo"$query - Success!";
                      }
When I run this 'Success' is out put to my screen indicating that the query has been sucessful, yet when I check the MYSQL table the update has not been made. I don't understand how this could be possible - any ideas?

Thanks,

Rob.

Re: Insane!

Posted: Wed Mar 25, 2009 2:18 pm
by requinix
mysql_query only tells if the query worked - not if it actually did anything.

Use mysql_affected_rows to see if anything changed.

Re: Insane!

Posted: Thu Mar 26, 2009 6:31 am
by spacebiscuit
Thanks that is useful to know.

I have found the problem, it was my sanity that was in question!!!

Rob.