m geting an unexpected error in my code plz tel me where am i wrng my code because i have wriiten mysql_num_rows many time
<?php
session_start();
print_r($_POST);
$con=mysql_connect("localhost","root","");
mysql_select_db("pras2",$con);
$slip_no=$_POST['slip_id'];
$query="SELECT * FROM `slip` WHERE slip_id='$slip_no'";
$result=mysql_query($query);
if ($result)
{
$query1= "UPDATE `slip` SET status='accepted' WHERE slip_id='$slip_no'";
$result1= mysql_query($query1);
if($result1)
{
if (mysql_num_rows($result1)==1)
{
$row=mysql_fetch_row($result1);
$shift_id=$row['shift_id'];
$product_name=$row['product_name'];
$quantity=$row['quantity'];
$query2= "INSERT INTO transfer_slip(shift_id, product_name, item1, num1, department_from, department_to) VALUES ( '$shift_id', '$product_name', 'handles', '$quantity', 'intermediate', 'tufting'";
$result2=mysql_query($query2) or die (mysql_error());
if ($result2)
{
echo " transfer slip generated";
}
else
{
echo "transfer slip failed";
}
}
}
else
{
echo "order not accepted";
}
}
else
{
echo "no slip found of this name";
}
?>
the error is
( ! ) Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\pras\acceptance_slip.php on line 20