gregaryb Posted August 1, 2022 Share Posted August 1, 2022 (edited) $strSQL = "SELECT * FROM '".$strTableName."' LIMIT 1"; $Result = $DBConnection->query($strSQL); echo "########".$strSQL."########<br>"; echo "########".$Result->num_rows."########<br>"; How do you do this successfully such that $Result->num_rows does not come back as null. Debug output is thus: @@@@@@@@@@@DoreenColes@@@@@@@@@ ########SELECT * FROM 'DoreenColes' LIMIT 1######## ################ I have successfully connected to my database at this point. The database DOES contain a table named "DoreenColes". And the table definitely contains 1 row of data. Edited August 1, 2022 by gregaryb Link to comment Share on other sites More sharing options...
Ingolme Posted August 1, 2022 Share Posted August 1, 2022 You have to delimit the table name with `backticks` instead of 'quotation marks' Link to comment Share on other sites More sharing options...
Chikwado Posted January 4 Share Posted January 4 SELECT * FROM table WHERE id = '1' AND firstname = 'Smith' Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now