Jump to content

Check 2 rows in DB


Winston_Smith

Recommended Posts

Ok I'm trying to check 2 rows in my DB, fname and lname. I want to check and see if the full name is in the DB and if so skip adding it. I'm very new at this, been playing with this for a while now. Now that I think about it it could match a first name from one row with a last name from another the way I was trying. This is what I've been working with, horrible I know.

 

$namechecker = mysql_query("SELECT * FROM ecfiber
WHERE fname='$fname'") or die(mysql_error()); 
$namechecker2 = mysql_query("SELECT * FROM ecfiber
WHERE lname='$lname'") or die(mysql_error()); 
$check = $namechecker.$namechecker2;
if ($check == false){

Link to comment
https://forums.phpfreaks.com/topic/119938-check-2-rows-in-db/
Share on other sites

Archived

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

×
×
  • 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.