PHP Classes

query implimentation

Recommend this page to a friend!

      MySQL_DB_Connect  >  All threads  >  query implimentation  >  (Un) Subscribe thread alerts  
Subject:query implimentation
Summary:needing some code to impliment the query
Author:Jason Denniston
Date:2005-05-03 22:08:27

  1. query implimentation   Reply   Report abuse  
Picture of Jason Denniston Jason Denniston - 2005-05-03 22:08:27
I'm using this db connect and I'm not sure how to impliment the query, or if Im supposed to tell it what table to use on the db.

Here my file so far:

$databaseLinkVariable = new mysql_db_connect();

echo "<h1>Jason's Wish List</h1>";
echo "<hr>";
$oneRowFromResult = $databaseLinkVariable->get_data();
print $getdata();

That gives me this error:
[04-May-2005 01:04:56]
PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/wesley/public_html/wishlist/classes/ on line 98

[04-May-2005 01:04:56]
PHP Fatal error: Call to undefined function: () in /home/wesley/public_html/wishlist/index.php on line 14

Lines 96-100 are:
// Returns the resultset, one row at a time in an array
function get_data() {
$this->dbResultLine = mysql_fetch_array($this->dbQryResult);
return $this->dbResultLine;

I have the cfg file set up, and I think it's connecting to the db just fine, but I can't get any information.

All I want to do is connect to the table 'items' and retrieve the data I have stored in the database, and print it plus some formatting, and a horizontal rule, then print the next record.