Jump to content

Recommended Posts

I am working with MySQL and a PHP script to lookup a user ID and password from a database. I can not however get it to return any results. it just says no such email. I can though see the database and the email address is there.

 

If I change the connection parameters I do get an error so it seems I am connecting. The database only has the three fields. Here is the code if someone see's my mistake any help would be greatly appreciated, thanks.

 

<?php

@mysql_connect("localhost", "login", "password!") or die("Cannot connect to DB!");

@mysql_select_db("database") or die("Cannot select DB!");

$query="SELECT email_webuser, id_webuser, passwd_webuser FROM b2bpasswords WHERE email_webuser=''".$email_webuser."''";

$r = mysql_query($query);

if(!$r) {

$err=mysql_error();

print $err;

exit();

}

if(mysql_affected_rows()==0){

print "no such email in the system. please try again.";

exit();

}

Link to comment
https://forums.phpfreaks.com/topic/148594-mysql-database-lookup/
Share on other sites

This is coming fom an HTML form that has one field, emial_webuser, with a POST action against forgot.php

 

I modified two lines to now be

 

$query="SELECT email_webuser, id_webuser, passwd_webuser FROM b2bpasswords WHERE email_webuser='".$email_webuser."'";

$r = mysql_query($query) or die(mysql_error());

 

I still get no such email in the system. please try again.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.