i have a problem with while loop.In this first column data is not getting remaining data is getting
here is my code
$result_By_Vendor_And_Title = mysql_query("select * from cek6q_jshopping_products where vendor_id = " . $vendor . " and name_en-GB='" . $title . "'");
if (mysql_fetch_array($result_By_Vendor_And_Title)) {
echo 'found';
while ( $rows = mysql_fetch_array($result_By_Vendor_And_Title) ) {
echo $id = $rows['product_id'];
}
}
echo 'not found';
Here i want to display all the ids but i have getting all the ids except first one how i can get first one.
found
is fetching and discarding the first row, Use mysql_num_rows() to identify if a result has been found.... then learn about MySQLi/PDO and prepared statements/bind variables – Mark Baker Oct 1 '13 at 7:19