jwwceo Posted September 5, 2006 Share Posted September 5, 2006 I have the following variable in my php code.$data = mysql_query("SELECT * FROM shirts WHERE active='true' ORDER BY '$field' '$direction'; "); at the end of this line of code there are two variables; $field and $direction. The query is not working right because there is no space between the two when php passes the query into MySQL. How do I insert a break in there so this query will work???? Link to comment https://forums.phpfreaks.com/topic/19750-spaces-in-php-character-string-for-mysql-query/ Share on other sites More sharing options...
zawadi Posted September 5, 2006 Share Posted September 5, 2006 $data = mysql_query("SELECT * FROM shirts WHERE active='true' ORDER BY '$field','$direction'"); Link to comment https://forums.phpfreaks.com/topic/19750-spaces-in-php-character-string-for-mysql-query/#findComment-86266 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.