Hi guys,
I have this code: Code: if(isset($_POST['selected'])) {
foreach($_POST['selected'] as $item) {
$sql = "SELECT * FROM tablename WHERE ID=$item";
mysql_query($sql) or trigger_error("SQL: $sql, ERROR: " . mysql_error(), E_USER_ERROR);
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
if ($num_rows>6) {
echo ("Too many checkboxes were selected");
}
else
while ($db_field = mysql_fetch_assoc($result)) {
echo "stuff that is ok if number of checkboxes is correct";
}
}
}
I am trying to limit the number of checkboxes that were selected, to say a max of 6. If the user selected any more than 6 a message should appear saying too many checkboxes were selected.
Can anyone see where i went wrong?
Cheers for any help fellas...
Troubles with a spider class
I am building a spider that will crawl through random whitepages (eg. anywho.com, switchboard.com, whitepages.com, etc..) and collect the information on the people found there and throw it into a
Disable Scrollbar in TableControl
Hello everbody,
how to populate a drop down box
Hi buddies!
Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a backflush code, or not populated with a code. I am aware of looking each part individually, but
str_replace help
Hey there,I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean up bad html to valid xhtml, I am using:Code: $pee = str_replace('&', '&', $pee);It
DOMDocument
Hello All,I need to take an XML document, modify some of the nodes in it and then perform a selective reordering of a subset of nodes. The modification I have done without too much difficulty -
Coefficient of a Restitution Hints
Hello. I was wondering if anyone can give me hints on how to write this program...The coefficient of a restitution of a ball, a number between 0 and 1, specifiies how much energy is conserved when a
How to add advertisment on top of videos
Hello,I was told that i should find the answer for this problem in this forums.I searched a lot but i couldnt find the solution .What i need to do is to add ads on top of the videos i have
LinkedList help
Ok so I just learned quickly about lists, so I have a not too hard project I think, but am having a few issues:Here is the project. Create a lovely polynomial calculator, that takes the equation from
Problem with the Update command used with a sqldataadapter
I'm connected to a database on an SQL Server and I'm using a sqldataadapter, sqlconnection, sqldataset generated at DESIGNTIME.