Jump to content

How do you select the first row of a table?


gregaryb

Recommended Posts

 $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 by gregaryb
Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...