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...
PHP Multiples of 2, Show posts...not working (wordpress)
I have been using this code to show div.example with 6 li columns inside it, each li is a post with its info inside.Once it gets to the 6th li it closes the div.example and starts a new one. This to
Confused with Loop
guys, i got confused with Looping...this is the caseI have 3 stocks, let say "Stock A", "Stock B", "Stock C" and the owner of each stock A --> Mr.Jamesstock B
question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.I have roughly 30 files. I want to be able to edit every $_POST and $_GETCode:
problem with GROUP BY and ORDER BY
i usually use this query to display the last 10 entries from a sql table:Code: $query = "SELECT search_time, search_keywords FROM phpbb_popsearch ORDER BY search_time DESC limit 35"; as you
SAP Project Module
I have seen in the SAP Project Module,plan cost and budget are not equal and even difference is significal for e.g Plan cost is 112 million where as budget is 136 million. In this situation what will
Simple email form - Newbie
Hello all,First time poster!I've been asked to create a simple HTML form that submits and sends the information to a particular email.The client is using PHP. Since I have a .NET and C# background,
License Issue - service type user
Hi,
empty() error
Why doesCode: empty($USER_ID = $_SESSION["USER_ID"])create this error...Parse error: syntax error, unexpected '=', expecting ')' in /home3/finestto/public_html/index.php on line 17
Unable to display contents in Second Drop Down Box
Hi All, What I am trying to do is 2 dependent drop down boxes and when user selects submit button the values are to be passed to the database to run a insert query. Right now, I am stuck
NOOB needs help with upload file
The intent of this form is to create a folder for a client and upload an image into another folder 'imagesClients'. The form works as follows: Username: selected from drop down menu.Folder: Slide