kinda urgent... conditional html displaying
Posted: Mon Feb 12, 2007 4:02 pm
Everah | Please use
Why doesn't something like this work? Any help is appreciated!!!
Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Basically my code checks for the number of rows for a value. If the value is within what it needs to be it displays a checkbox, if it doesnt then it will not display anything.Code: Select all
$dbh=mysql_connect ('localhost','user','pass') or die ("Unable to connect to MySQL server: <br>" . mysql_error());
mysql_select_db ('databasename', $dbh) or die ("Unable to select database: <br>" . mysql_error());
$query = "SELECT * FROM database WHERE code='ES-C1-07'";
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
if ($numrows > "30") { // if program is full
}
else
{
<input type="checkbox" name="ES-C1-07" value="ES-C1-07">;
}Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]