Shadowing Posted December 21, 2011 Share Posted December 21, 2011 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 More sharing options...
scootstah Posted December 21, 2011 Share Posted December 21, 2011 There's no difference. Link to comment https://forums.phpfreaks.com/topic/253584-question-on-queries/#findComment-1299987 Share on other sites More sharing options...
jcbones Posted December 21, 2011 Share Posted December 21, 2011 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 More sharing options...
Shadowing Posted December 21, 2011 Author Share Posted December 21, 2011 thanks guys was wondering about that for a while and thanks for the examples jcbones Link to comment https://forums.phpfreaks.com/topic/253584-question-on-queries/#findComment-1299993 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.