Jump to content

trouble getting results from query


webdevdea

Recommended Posts

Ok as you all know im still learning after hours of struggling over the sql code, I cannot get it to pull up in php. 

I have looked over books and sites. I cannot figure out what is wrong with the code. I am getting a 500 error

Here is the code if you could give it a once over and see if anything sticks out to you professionals that would be greatly appreciated. 

  $result = mysql_query("SELECT (
d.theCost + r.theCost + n.theCost
) AS TheBIll
FROM doctor AS d, account AS a, room AS r, nurse AS n
WHERE d.doctorID = a.doctorID
AND r.roomID = a.roomID
AND n.nurseID = a.nurseID");

  echo "<table border='1'>
  <tr>
  <th>User Name</th>
  
  </tr>";

  while($row = mysql_fetch_array($result)){
  echo "<tr>";
  echo "<td>" . $row['TheBill']  "</td>";
 
  echo "</tr>";
  }
  echo "</table>";

  mysql_close($con);
?>
Link to comment
https://forums.phpfreaks.com/topic/283725-trouble-getting-results-from-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.