SQL syntax 'Resource id #2'
Posted: Thu Jul 31, 2003 3:40 am
I've never seen this one before, and can't work out what is wrong with my code:
It's really simple. I just want to list the Companies. However it comes back with the following MySQL Error:
Any ideas anyone?
Please!!!!
Code: Select all
<?php
$company_sql="SELECT * FROM `Company`";
$company_result=mysql_query($company_sql,$connect);
echo($company_sql);
?>
<table width="80%" align="center">
<tr>
<th>Name</th>
<th>Town/City</th>
<th>Venue Host</th>
</tr>
<?php
while ($company=mysql_query($company_result)) {
?>
<tr>
<td><?php echo($company["Name"]); ?></td>
<td><?php echo($company["City"]); ?></td>
<td><input type="checkbox" <?php if ($company["Course_Location"]==1) { echo("CHECKED"); } ?>></td>
</tr>
<?php
}
?>Code: Select all
You have an error in your SQL syntax near 'Resource id #2' at line 1Please!!!!