I'm writing a simple PHP cgi program that needs to use MySql. I started with two columns in the players table, and my SELECT worked fine. I have added another column since then called class_id. When I do a SELECT now, I get three entries back in $row, but the third entry is called players instead of class_id.
$sql = "SELECT * FROM players";
$result = $conn->query($sql);
while( $row = $result->fetch_assoc() ){
do something
}
The schema:
DROP TABLE IF EXISTS `asrleague`.`players`;
CREATE TABLE `asrleague`.`players` (
`player_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kgs_handle` varchar(40) NOT NULL,
`class_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`player_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
Is PHP caching info about the table somewhere, and I need to get it to refresh somehow?
I'm also seeing this warning, which has been there all the time:
<b>Warning</b>: mysqli::mysqli() [<a href='mysqli.mysqli'>mysqli.mysqli</a>]: Headers and client library minor version mismatch. Headers:50145 Library:50018 in ...
I'm not sure if that's related or not, but it was there before the problem started.
Some Googling on your error message, gives those interesting threads:
Seems that a reinstallation of PHP could be necessary.
Quoting an answer (anishmsry's) from the first link (bold is from me):