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? 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 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. 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')"); Link to comment https://forums.phpfreaks.com/topic/74876-variables-in-sql/#findComment-378574 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.