dodgeitorelse Posted October 16, 2011 Share Posted October 16, 2011 I have an included file that has my table defined as $db_table_name = "19"; and when I put it into my query like $sql = 'select name, score from $db_table_name ORDER BY score desc limit 10'; it doesn't work. How do I put the variable into my query? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 16, 2011 Share Posted October 16, 2011 Change the quotes to double quotes. Variables aren't interpolated within single quotes. If you'd echoed the query, you would have seen that. Quote Link to comment Share on other sites More sharing options...
dodgeitorelse Posted October 16, 2011 Author Share Posted October 16, 2011 oh man, what a dumb lookover, thank you for the reply and yes it works :-\ Quote Link to comment 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.