Gamerz Posted January 9, 2010 Share Posted January 9, 2010 Okay, so I'm trying to select everything from a user table...and every user has there own table --- $sql = "SELECT * FROM '{$username}' order by Folder_Display_Order ASC"; Why doesn't this work, and how do I make it work? BTW, I also made the $username = "adminis"; to prove it...and it didn't return to my anything...supposedly if it worked, it would return to my folder names on my table... Quote Link to comment https://forums.phpfreaks.com/topic/187887-why-doesnt-thios-mysql-query-from-php-page-work/ Share on other sites More sharing options...
Mchl Posted January 9, 2010 Share Posted January 9, 2010 Try: $sql = "SELECT * FROM '$username' order by Folder_Display_Order ASC"; $result = mysql_query($sql) or die(mysql_error().": $sql"); Quote Link to comment https://forums.phpfreaks.com/topic/187887-why-doesnt-thios-mysql-query-from-php-page-work/#findComment-992010 Share on other sites More sharing options...
PFMaBiSmAd Posted January 9, 2010 Share Posted January 9, 2010 Single-quotes make things string data values, not column or table identifiers. Quote Link to comment https://forums.phpfreaks.com/topic/187887-why-doesnt-thios-mysql-query-from-php-page-work/#findComment-992012 Share on other sites More sharing options...
Gamerz Posted January 9, 2010 Author Share Posted January 9, 2010 Alright, thanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/187887-why-doesnt-thios-mysql-query-from-php-page-work/#findComment-992013 Share on other sites More sharing options...
Mchl Posted January 9, 2010 Share Posted January 9, 2010 Single-quotes make things string data values, not column or table identifiers. OK. Seems it's too late to me to spot obvious things. Good night all. Quote Link to comment https://forums.phpfreaks.com/topic/187887-why-doesnt-thios-mysql-query-from-php-page-work/#findComment-992016 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.