thisagain Posted July 20, 2006 Share Posted July 20, 2006 This query string works:$query = 'SELECT * FROM `models` WHERE `fname` = CONVERT(_utf8 \'[color=red]Trains[/color]\' USING latin1) COLLATE latin1_swedish_ci';...but I want to make [color=red]Trains[/color] a variable called $fname; however when I try and change Trains to $fname, the query show up emptyif it helps, the variable $fname is passed onto the page by $fname=$_GET['name'];If anyone can help me with this, it would be greatly appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/15169-need-help-placing-variable-in-query/ Share on other sites More sharing options...
wildteen88 Posted July 20, 2006 Share Posted July 20, 2006 Use double quotes:$query = "SELECT * FROM `models` WHERE `fname` = CONVERT(_utf8 '$fname' USING latin1) COLLATE latin1_swedish_ci"; Quote Link to comment https://forums.phpfreaks.com/topic/15169-need-help-placing-variable-in-query/#findComment-61123 Share on other sites More sharing options...
thisagain Posted July 20, 2006 Author Share Posted July 20, 2006 I feel stupid now. But Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/15169-need-help-placing-variable-in-query/#findComment-61129 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.