I have (with some help from a couple people here) finally got my code working so I can add info to my database via my web site.
Now I need to get data out of it and displayed on that same site. Using my text book and a PHP tutorial I found online I came up with this:
<?php
$sql = "SELECT system FROM discs WHERE column = 'Xbox'";
$q = $db->query($sql);
if(DB::IsError($q)) {
die($q->getMessage());
}
// if no error, script continues
$result = $q->fetchRow();
?>
However I keep getting this error:
Fatal error: Call to a member function on a non-object in /home/.../xbox.php on line 17
which happens to be this line from the code above:
$q = $db->query($sql);
Am I missing a step or something? I (for this particular web page) want to extract from my 'discs' table all the entries where the column 'system' has the value of 'Xbox'.
Thanks in advance!