Jump to content


Photo

the "list" command and PEAR


  • Please log in to reply
1 reply to this topic

#1 a1ias

a1ias
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 13 August 2006 - 09:29 AM

Hi all

I'm learning the PEAR db classes for querying mySQL databases and not far into the subject, I've hit a snag.

A simple variation of my code is as follows:

<?php

/* include the config files up here */

$sel = $database_1->query("select email from users where field = '$value'"); // users table is made up of id,username,email,age

list($email) = $sel->fetchRow();

echo $email;

?>

The above gives me the follwing error:

Notice: Undefined offset: 0 in .....path_to\getmail.php on line *


Can any of the pros advise of the issue?

Thanks in advance

a1ias

#2 a1ias

a1ias
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 13 August 2006 - 09:39 AM

forget to mention that the fetchmode has been set to (DB_FETCHMODE_ASSOC) in the config files.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users