Jump to content

Archived

This topic is now archived and is closed to further replies.

a1ias

the "list" command and PEAR

Recommended Posts

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:

[code]
<?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;

?>
[/code]

The above gives me the follwing error:
[i]
Notice: Undefined offset: 0 in .....path_to\getmail.php on line *[/i]

Can any of the pros advise of the issue?

Thanks in advance

a1ias

Share this post


Link to post
Share on other sites
forget to mention that the fetchmode has been set to (DB_FETCHMODE_ASSOC) in the config files.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.