I am newbie in php and i have code for retreving data from the website where the $id=id now i want to retreive the data based on the code Select * from users where cat1=cat1 and cat2=cat2 and also show the data according to the id in decrement order. i paste my code below can any one solve this . Thanks in advance :)
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="forum_question"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// get value of id that sent from address bar
$id=$_GET['id'];
$sql="SELECT * FROM $tbl_name WHERE id='$id'";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
?>
Here is the sample code now i want to add some extent to select from where cat1=cat1