when we do mysql_query with while and mysql_num_rows() together then while do no show the first row from table in database..
example :
<?
$conn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName"); $sqlquery = "SELECT * FROM $table WHERE opinion = 'is great'";
$result = mysql_query($sqlquery,$conn);
$number = mysql_num_rows($result); //to get the total rows
echo "Total row is " . $number ;
while($rows = mysql_fetch_assoc($result)) //show all the values in all rows in table
{
echo $uid = $row['id'];
echo $name = $row[''name];
}
//while show not the first value in the row , to show the value in first and all other //rows we have to run the another $sql_query and that is not good idea ...
exit;
?>
please tell me how to resolve it...thanks..