MySQL Forums
Forum List  »  PHP

Null returned when row has values
Posted by: Herb Isaacs
Date: July 14, 2016 01:24PM

I am a newbie to php/mysql. I have a test php script that has successfully connected to a mysql database which has a single table and one record populated in all fields. When I do a var_dump of my results, I get NULL. I have queried the database both in Mysqlworkbench and phpmyadmin. Both return the record, but my code does not. Here is the code, minus the connection details:

*******************************************
mysql_select_db ("herbisaa_fsr", $dbh);

echo "completed connection<br>";

$q=mysqli_query($dbh, "SELECT FirstName, LastName FROM herbisaa_fsr.MasterPerson");

echo "completed query<br>";

var_dump($q );
********************************************************

Here is what I get from my script:
completed connection
completed query
NULL

I am at a loss to figure this out. Any help would be greatly appreciated.

Herb

Options: ReplyQuote


Subject
Written By
Posted
Null returned when row has values
July 14, 2016 01:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.