can somebody please look at my queries?
Posted: Mon Sep 13, 2010 8:52 pm
ive had these queries working okay until i checked on it today, it's not working anymore..
these are the errors:::
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\arrastre\add.php on line 105
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\arrastre\add.php on line 117
if(isset($_POST['add'])){
if($billnmbr=="" or $orno=="" or $payor=="" or $arrastre=="" or $wharfage=="" or $total=="" or $date=="" or $tcl==""){
echo "At least one field was left blank.";
}
else{
$query = mysql_query("select * from `arrastre` WHERE `billnmbr`='$billnmbr'"); /*****************this is my line 105************/
$count = mysql_num_rows($query);
if($count==1){
echo "This billnumber is already in the database.";
}
else{
$bll = strtoupper($billnmbr);
$payr = strtoupper($payor);
$query="insert into `arrastre` (`billnmbr`, `orno`, `payor`, `arrastre`, `wharfage`, `total`, `date`, `tcl`)
values ('$bll', '$orno', '$payr', '$arrastre', '$wharfage', '$total', '$date', '$tcl')";
$result=mysql_query($query);
$query = mysql_query("select * from `arrastre` where `billnmbr`= '$billnmbr'", $link); /************and this is my line 117*************/
$count = mysql_num_rows($query);
if($count==1){
echo "last bill number added: ".$billnmbr;
}
}
Thank you very much for your time and have a nice day.
these are the errors:::
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\arrastre\add.php on line 105
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\arrastre\add.php on line 117
if(isset($_POST['add'])){
if($billnmbr=="" or $orno=="" or $payor=="" or $arrastre=="" or $wharfage=="" or $total=="" or $date=="" or $tcl==""){
echo "At least one field was left blank.";
}
else{
$query = mysql_query("select * from `arrastre` WHERE `billnmbr`='$billnmbr'"); /*****************this is my line 105************/
$count = mysql_num_rows($query);
if($count==1){
echo "This billnumber is already in the database.";
}
else{
$bll = strtoupper($billnmbr);
$payr = strtoupper($payor);
$query="insert into `arrastre` (`billnmbr`, `orno`, `payor`, `arrastre`, `wharfage`, `total`, `date`, `tcl`)
values ('$bll', '$orno', '$payr', '$arrastre', '$wharfage', '$total', '$date', '$tcl')";
$result=mysql_query($query);
$query = mysql_query("select * from `arrastre` where `billnmbr`= '$billnmbr'", $link); /************and this is my line 117*************/
$count = mysql_num_rows($query);
if($count==1){
echo "last bill number added: ".$billnmbr;
}
}
Thank you very much for your time and have a nice day.