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