walexman Posted October 26, 2007 Share Posted October 26, 2007 Sometimes when I use variables in an sql statement it doeswork. How come it works sometimes and not others? Quote Link to comment https://forums.phpfreaks.com/topic/74876-variables-in-sql/ Share on other sites More sharing options...
MasterACE14 Posted October 26, 2007 Share Posted October 26, 2007 depends on what the code is Quote Link to comment https://forums.phpfreaks.com/topic/74876-variables-in-sql/#findComment-378550 Share on other sites More sharing options...
GingerRobot Posted October 26, 2007 Share Posted October 26, 2007 The should always work, if you use them correctly. Perhaps if you show us some code where you are having problems we can help you. Quote Link to comment https://forums.phpfreaks.com/topic/74876-variables-in-sql/#findComment-378563 Share on other sites More sharing options...
unidox Posted October 26, 2007 Share Posted October 26, 2007 Just do: $var1 = "blah"; $var2 = "blah2"; MYSQL_QUERY("INSERT INTO `table` (var1,var2) VALUES ('$var1', '$var2')"); Quote Link to comment https://forums.phpfreaks.com/topic/74876-variables-in-sql/#findComment-378574 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.