Hello,
I am using this code and getting this error given below:-
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\database login new\buyers_substance_view.php on line 46
Please check the code is given below:-
<?php
$title="Buyers Substance Report";
$page_name="Buyers Substance Report";
include("includes/header.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>company info search</title>
</head>
<body>
<div style='overflow:auto; height:300px;'id=buyer_detail>
<form action="buyer_substance_save.php" method="post">
<table border="1" align=center cellpadding=5 bgcolor="#CCCCCC">
<tr>
<th>Buyer Name</th>
<th>Substance Name</th>
<th>CAS No</th>
<th>EC no</th>
</tr>
<?php
$where="";
if(!empty($_GET)){
$s_name=$_GET;
$where="where c_id='$s_name'";
}
db_connect();
$qry="select * from company $where";
$result=mysql_query($qry);
$row=mysql_fetch_array($result);
echo $buyer_query="select * from buyers_detail where company_id='".$row."and buyer_id='".$_GET."'";
// $buyer_query="select * from buyer_detail where buyer_id='".$_GET."'";
$result2=mysql_query($buyer_query);
$buyer_query_result=mysql_fetch_array($result2);
$qry1="select * from substance where company_id='".$row."'";
$result1=mysql_query($qry1);
$qry2="select * from buyers_substances where buyer_id='".$_GET."'";
$result2=mysql_query($qry2);$substance_array=array();
while($row2=mysql_fetch_array($result2))
{
$substance_array[]=$row2;
}$count=0;
while($row1=mysql_fetch_array($result1))
{
$id=$row1;
if(in_array($id, $substance_array)){
echo"<tr><td>".$buyer_query_result."</td><td>".$row1."</td><td>".$row1."</td><td>".$row1."</td></tr>";
$count=1; }
}
if($count==0)
echo"<tr><td colspan=3><center>No Substance Found</center></td></tr>";
?>
<input type=hidden name=buyer_id value="<?php echo $_GET; ?>">
</table>
</div><br />