I have two tables One is registration and the other is user table: I want to search records from both the tables, i can search the record from one table by the step given below but did not know at the same time some text fiels are there in my form which should match with the records in the database i.e. name and address are comming from the other tables.
<?
$gender=$_POST['GENDER'];
$age=$_POST['AGE'];
$Religion=$_POST['RELIGION'];
$name=$_POST['NAME'];
$address=$_POST['ADDRESS'];
$sql = mysql_query("select * from registration where `religion` LIKE '%".$Religion."%' AND `age` LIKE '%".$age."%' AND `gender` LIKE '%".$gender."%'") or die(mysql_error());
while($row=mysql_fetch_array($sql)){
---
--
}
My Table Description is as follows:
Registration Table:
Userid
Gender
Age
Religion
User Table:
uid
name
address