|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Fatal error: Call to a member function on a non-objec
<?php
require('db_connect.php'); $result = $conn->query ("SELECT name, category FROM animal"); if (DB::isError ($result)) die ("SELECT failed: " . $result->getMessage () . "n"); printf ("Result set contains %d rows and %d columnsn", $result->numRows (), $result->numCols ()); while ($row = $result->fetchRow (DB_FETCHMODE_ASSOC)) printf ("%s, %sn", $row["name"], $row["category"]); $result->free (); $db_object->disconnect(); ?> i am trying to return a value from a selected field actually fields and testing them with php4 and mysql and i just started using pear.....can someone help me and point me in the right direction? |
|
#2
|
||||
|
||||
|
RE: Fatal error: Call to a member function on a non-objec
Your using PEAR DB right?
$result =& $conn->query ("SELECT name, category FROM animal"); You forgot the ampersand for the return value. You were only getting a copy of the result set - not the actual result set. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > Fatal error: Call to a member function on a non-objec |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|