It sais Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given on line74 and I tried a lot of things.
here is code
[$query="SELECT *
FROM specificati,ofertant,suprafete,preturi,manopera
WHERE ofertant.id_ofertant=preturi.id_ofertant
AND preturi.id_manopera='Montaj parchet'
AND preturi.id_manopera=manopera.id_manopera
AND specificati.id_camera=suprafete.id_camera
";
if (isset($query) && !empty($query)) {
echo"<!--" . $query . "-->";
$result=mysql_query($query)
or die ("invalid query 4: " . mysql_error ());}
//Multiple results per table (each ina a row)
//start table
while($row=mysql_fetch_array($result))
{{
echo "<table><table border='1'>
<th>id_ofertant</th>
<th>Denumire Camera</th>
<th>Manopera</th>
<th>U.M</th>
<th>Suprafata(mp)</th>
<th>Pret</th>
<th>Total</th>";
echo "<tr><td>";
echo $row['id_ofertant'];
echo "</td><td>" ;
echo $row['Denumire_camera'] ;
echo "</td><td>" ;
echo $row['id_manopera'];
echo "</td><td>" ;
echo $row['um'] ;
echo "</td><td>" ;
echo $row['Paviment'];
echo "</td><td>" ;
echo $row['Pret_manopera'];
echo"</td><td>" ;
$Total=$row['Pret_manopera']*=$row['Paviment'];
echo $Total;
echo"</td></tr>";
echo "</table>";
}
}
?>
<?php
$query1="INSERT INTO valoare_lucrari
(
id_ofertant,
id_manopera,
Denumire_camera,
um,
Cantitate,
Pret_manopera,
Total
)Values(
'" . $row['id_ofertant'] ."' ,
'" . $row['id_manopera']."',
'" . $row['Denumire_camera'] ."' ,
'" . $row['um']."' ,
'" . $row['Paviment']."',
'" . $row['Pret_manopera']."',
'" . $Total . "')";
if (isset($query1) && !empty($query1)) {
echo"<!--" . $query1 . "-->";
$result1=mysql_query($query1)
or die ("invalid query 5: " . mysql_error ());}
//Here is line 74
while($row=mysql_fetch_array($result1)){
echo "Insert succeded";
};