Jump to content

Question on queries


Shadowing

Recommended Posts

whats the differance between

 

mysql_query("UPDATE banned SET time

 

and doing

 

$safe4 = "UPDATE banned SET time

mysql_query($safe4);

 

 

is there a reason as to why do it the 2nd way i mentioned?

 

if someone could please explain it to me so i wont be in confusion on this anymore :)

Link to comment
https://forums.phpfreaks.com/topic/253584-question-on-queries/
Share on other sites

The reason to do it the second way is for error handling.

$safe4 = "UPDATE banned SET time";
mysql_query($safe4) or trigger_error($safe4 . ' has encountered and error<br />' . mysql_error());

is much more descriptive than:

mysql_query("UPDATE banned SET time") or trigger_error(mysql_error();

 

Link to comment
https://forums.phpfreaks.com/topic/253584-question-on-queries/#findComment-1299990
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.