I am trying to move some code to php5 & mysqli objects and I am running into a problem with getting a row in an associative array.
The keys to not seem to be coming over correctly. I have included the code I am using and the var_dump() of one of the rows I get back from the $result->fetch_assoc() line.
PHP Code:
$query = "SELECT * FROM news WHERE Topic LIKE '$topic' ORDER BY Date DESC" ;
$result = $this->mysqli->query($query);
$returned_ID = array();
while ( $row = $result->fetch_assoc() ) {
var_dump($row);
$returned_ID[] = $row['ID'];
}// end while rows returned
return $returned_ID;
var_dump result - (this is a news story I am pulling from the database with fields ID, date, category, title, and body)
array(5) { ["B"]=> string(2) "51" ["€"]=> string(10) "2004-11-14" [" @"]=> string(3) "All" [""]=> string(15) "EMAIL BACK UP!!" [""]=> string(726) " Due to a power outage hosing our email server late Thrus. night we had to move to a new system. It is in place and the link to your email from the front page will work to get you to the new system.
Your username is the same, please either email me from another account or call me at 810-441-6454 (cell) to get your new password.
I am still working on recovering the old email messages and I will get those to everyone as soon as I can save what I can.
I cannot apologize enough for this trouble and if there is anything I can do to help ease the trouble this has caused don't hesitate to ask.