Click here to Skip to main content
15,915,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

i need to get some information abouth my application form.i have NIC number if user fill it need to check that inserted number is already in my database.can you please give me the suggestion to solve this problem
this is the part of the code

PHP
$nic_vali = mysql_quary("SELECT nic FROM application WHERE nic='$nic'");
		
		if(mysql_num_rows($nic_val) > 0) {
                
                 echo '<script type="text/javascript">alert("NIC number already in System.please check again");</script>';
		
		}


this is the code that i have used.but it is not checking and data also not inserting the database if i click the add button.
Posted
Updated 29-Jan-15 21:00pm
v3
Comments
Zoltán Zörgő 30-Jan-15 3:06am    
What is the error message you got?
Sinisa Hajnal 30-Jan-15 6:29am    
Can you confirm that your click handler triggers correctly? put an alert as first instruction in the click event.

1 solution

I thing its correct ...uou just change "mysql_quary" to "mysql_query"

$nic_vali = mysql_query("SELECT nic FROM application WHERE nic='$nic');

if(mysql_num_rows($nic_val)>0) {

echo '<script type="text/javascript">alert("NIC number already in System.please check again");</script>';

}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900