I have the following code which works:
$date1 = mysql_query("SELECT date1 FROM Users WHERE username='".$_SESSION['username']."'")
or die(mysql_error());
while($row = mysql_fetch_array($date1)){
$lastViewedDate = $row[0];
}
But when I try to use mysql_fetch_object I get an Internal Server Error 500.
$date1 = mysql_query("SELECT date1 FROM Users WHERE username='".$_SESSION['username']."'")
or die(mysql_error());
while($row = mysql_fetch_object($date1)){
$lastViewedDate = $row["date1"];
}
I would prefer to use the objects in the future but I don’t understand why they aren’t working. Any help would be appreciated.
With fetch_object the syntax is :
with fetch_assoc the syntax is:
Also please.. for everything that is holy.. Turn E_NOTICE error messaging and display_errors on