Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

MYSQL NUM ROW CHECK NOT WORKING

$
0
0

Hi there, 

 

Am submitting an excel spread sheet via an upload php script I check in the do loop to see if the info already exists in my selected database using the info below

 

 
 $check_for_duped_person=mysql_num_rows(mysql_query("SELECT `id` FROM `delivery_information` WHERE `contact_name`='$recipient_name' AND `post_code`='$ship_postal_code'"));
 
 if($check_for_duped_person="1"){echo"error $check_for_duped_person $recipent_name";}else{
 

 

It always seems to return 1 when even when the table delivery_information is empty.

 

I need to make sure that the duplicated rows in the CSV file aren't submitted twice. This can only be done by the upload script and the above coding.

 

I can not do it via excel as it will be user submitted  

 

any help will be greatly appreciated

 

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles