Jump to content

[SOLVED] Form doesnt show due to php conflict ( i think )


Recommended Posts

I decided to load some of my form via php as it was needed to generate a combo box with infomation from a query.. this is what i have yet it doesn't load up on my browser....

 

<div id="bv_" style="position:absolute;left:46px;top:279px;width:874px;height:345px;z-index:4" align="left">
<form name="" method="POST" action="businesslondonstage2.php" enctype="text/plain" id="Form1">
<?php
$CountNames = ("SELECT *, count(BusinessType) as C FROM `businesses` GROUP BY BusinessType HAVING C < 3");
$findbusinessresult = @mysql_query($CountNames) or die(mysql_error());

echo '</br></br><center><select name="businesslist" size=10>"></center>';
	Echo'<option value =""><b><u>Business Types</b></u></option>';
while($row = mysql_fetch_array($findbusinessresult)) {
        echo "<option value=\"{$row['BusinessType']}\">{$row['BusinessType']}</option>";
	}
echo '</select>';


?>

<input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:358px;top:215px;width:75px;height:45px;z-index:1">
<input type="checkbox" id="Checkbox1" name="Checkbox1" value="" style="position:absolute;left:466px;top:232px;z-index:2">
</form>
</div>

 

What is causing it not to show on the page.. the page source also shows nothing.

You have a syntax error in you mysql query, replace "HAVING" with "WHERE":

<?php
$CountNames = ("SELECT *, count(BusinessType) as C FROM `businesses` GROUP BY BusinessType WHERE C < 3");
?>

 

This would have shown if you didn't have the "@" before the mysql_query() function. This symbol suppresses error messages and should not be used when developing & debugging scripts.

 

Ken

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.