Jump to content


Photo

retrieving and displaying a specific data from a database?


  • Please log in to reply
1 reply to this topic

#1 bilis_money

bilis_money
  • Members
  • PipPipPip
  • Advanced Member
  • 621 posts

Posted 03 July 2006 - 05:39 AM

hi, guys

i'm trying to display a record with the following condition & codes below;
$sql->QueryRow("select * from photos where photo_filename = $cur_file");
$row = $sql->data;

$max_array = count($row);

echo $row[id];

but these codes threw me an error message here;

Fatal error: Call to a member function on a non-object in /home/askjames/public_html/mygallery/img_info.php on line 30


and line 30 is the first line of codes above and so on...
$cur_file is the name of the current .gif file in the directory.

what do you think is the reason of this error message?
please help me to figure out this?

thank you very much.






#2 Brandon Jaeger

Brandon Jaeger
  • Members
  • PipPipPip
  • Advanced Member
  • 155 posts
  • LocationPA
  • Age:25

Posted 03 July 2006 - 06:27 AM

$sql = new sql; // or whatever the class' name is

Put that above the line with the error.
PHP is my friend (=




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users