I keep getting the following error Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in.... on line 7 in the code below:
<?phpsession_start();include("header.php");include("sidebar.php");include("dbconnection.php");$result= mysql_query("select * from service where serviecid='$_POST[serviceid]'");$row1 = mysql_fetch_array($result);$result1= mysql_query("select * from customer where custid='$_POST[customerid]'");$arrrec2= mysql_fetch_array($result1);$dt = date("Y-m-d");if($_POST["vehstatus"] == "Completed"){ $sql ="insert into billing(serviceid,particulars,scost,date,paidstatus) values('$_POST[serviceid]','$_POST[particulars]','$_POST[vehcost]','$dt','$_POST[vehstatus2]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } $insid = mysql_insert_id(); mysql_query("UPDATE service SET status='$_POST[vehstatus]' where serviecid='$_POST[serviceid]'");}if($_POST["vehstatus"] == "Cancelled"){ $sql ="insert into billing(serviceid,particulars,scost,date,paidstatus) values('$_POST[serviceid]','Calncelled','0.00','$dt','Cancelled')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } $insid = mysql_insert_id(); mysql_query("UPDATE service SET status='$_POST[vehstatus]' where serviecid='$_POST[serviceid]'");}?> <div id="main"> <a name="TemplateInfo"></a> <?phpif($ctins == 1){ echo "<center><b>Employees account created successfully...</b></center><br>"; echo "<center><b><a href='emplogin.php'>Click here to Login.</a></b></center>";}else{ ?> <form id="form1" name="form1" method="post" action=""> <table width="494" border="1"> <tr> <th colspan="2" scope="col"><h1>E-Workshop</h1></th> </tr> <tr> <th height="40" scope="col">Bill No. : <?php echo $insid; ?></th> <th scope="col">Date: <?php echo $dt; ?></th> </tr> <tr> <th width="237" height="45" scope="col">Sevice ID: </th> <th width="241" scope="col"> <?php echo $_POST[serviceid]; ?></th> </tr> <?p ... ... ... to be continued.
viewservicebillingreport.php