if u are looking to match postal address with the existing one in the database, its hard as you see there are many ways to write an address like:
274 e block sbs nagar
274 e sbs nagar
e block-274 sbs nagar
u can use "like" operator in the query, but it would n't match exact address.
other way u can explode the input address by space and match each of the array element with like operator in the query using while loop. Then you can use AND condition for all query results to match the address. something like that may work...
SELECT *
FROM `newsletter`
WHERE `address` = CONVERT( _utf8 '$address'
USING latin1 )
COLLATE latin1_german2_ci
LIMIT 0 , 30
but how can i tell it if it finds it,to give an error, else to continues with the code
You can check mysql_num_rows() function and if it's zero, there was no match. But as ocpamit warned, this is probably unworkable because of the possibility of entering an address in so many ways. It is likely to miss finding a match a high percentage of the time.