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 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"; 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! 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
Archived
This topic is now archived and is closed to further replies.