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 Quote 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. Quote 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(); Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/253584-question-on-queries/#findComment-1299993 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.