i've got a script which is meant to run a database query, however when trying to run this script i get the error Fatal error: Call to a member function fetch() on a non-object in /var/www/Quack/doSetup.php on line 209 - 209 being the while loop. I'm 99% sure this corresponds to there being a missing column in my database, however i can't work out which one it doesn't like. I was hoping this try catch system might tell me, it doesn't. Is there any way i can get this too give me more information on what it cannot find?
try{
$query = $db->query("SELECT articles . title FROM articles");
$query = $db->query("SELECT title FROM articles");
$SQLGetLogs = $conn -> query("SELECT `payments`.* , `plans`.`name` AS `planname`, `users`.`username` FROM `payments` LEFT JOIN `plans` ON `payments`.`plan` = `plans`.`ID` LEFT JOIN `users` ON `payments`.`user` = `users`.`ID` ORDER BY `ID` DESC");
while($getInfo = $SQLGetLogs -> fetch(PDO::FETCH_ASSOC)){
echo 'true';
}
}
catch(PDOException $e){echo 'My test failed: ' . $e->getMessage();}