CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 No Result when searching for email

Print topic Send  topic

Author Message
oishyasan
Posted: 06/01/2002, 5:40 PM

Hi, I am using the following code:
I definitely have an email I am testing with - why does it come out as not there?

$email = get_param("email");
$db->query("SELECT member_id FROM members WHERE email=" . tosql($email, "Text"));
$mem = $db->f("member_id");

if ($mem == ""){
echo "I am sorry, the email, ". $email ." is not in our database";
exit;
}
Brent
Posted: 06/01/2002, 10:05 PM

I'd recommend putting in a debugging statement.

Try:

$email = get_param("email");
$sql = "SELECT member_id FROM members WHERE email=" . tosql($email, "Text");
echo $sql;
$db->query($sql);
$mem = $db->f("member_id");

when the $sql id displayed, copy and paste it into a database query window and
execute it to see if it returns any rows. If it doesn't, then the sql statement
is constructed incorrectly or you don't have a row in the table for the query.
Are you sure you have an "email" parameter?

Brent
oishyasan
Posted: 06/01/2002, 11:49 PM

Hi Brent,

I appreciate your reply. This baby has me stumped! I did try the debugging lines and it showed the full sql and even the email parameter. I do have that field in the table and I do have the email address I searched for. It brings back nothing for the member ID...I have tried a number of ways...may just leave this one out...thanks...
Labs4.com
Posted: 06/02/2002, 2:12 AM

Query is correct but data type will be wrong
check your grid settings, you have probably another data type (Integer) where Text have to be displayed ;-)

Josef
Brent
Posted: 06/02/2002, 8:32 AM

oishyasan,
Joseph could be right, check the data type. Also the problem could be you
don't have the correct user pw entered that grants you access to that table
so you should check to see if there is an error message.

Try:

echo $db->Error();

Also if you post the $sql value on this forum, we'll take a look at it. (Copy and
paste it from the echo stmt displayed in your browser window.) Did you run this
SQL statement through a MySQL program like MySQLFront? www.mysqlfront.de

Brent

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.