Jump to content


Photo

not updating an update


  • Please log in to reply
2 replies to this topic

#1 Goochi

Goochi
  • Members
  • Pip
  • Newbie
  • 3 posts
  • LocationBelgium

Posted 09 December 2003 - 08:21 PM

I got following code at my fanlisting-script..

$query = \\\"UPDATE fanlisting SET censor = \'n\' WHERE id = \'$uncensor\'\\\"; mysql_query ( $query ); echo $query . \'<br>\';


this should modify a record in the datebase + output the SQL-code to the screen with the echo. The output to the screen is

UPDATE fanlisting SET censor = \'n\' WHERE id = \'50\'


but in the DB isn\'t happening anything.. while when I copy the output that appears on the screen (second quote) and I paste it in my phpMyAdmin then it does update the record.

What might cause this ?
thanks
-xxx-

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 09 December 2003 - 08:50 PM

Try this

$query = "UPDATE fanlisting SET censor = \'n\' WHERE id = \'$uncensor\'"; mysql_query($query) or die(mysql_error());echo $query.\'<br>\';

see if you get any error when you execute this. I have added mysql_error() which will report if there is any error.
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 Goochi

Goochi
  • Members
  • Pip
  • Newbie
  • 3 posts
  • LocationBelgium

Posted 09 December 2003 - 08:54 PM

very choqing.. \"No Database Selected\" :oops:
thanks for helping.. very handy the mysql_error..
-xxx-




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users