Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Maximum Dropdown Size


I have a strange issue with dropdowns. Using php4, mySQL5, Apache 2 on
a fast XP pro PC, I have a form which requires 5 dropdowns populated
with indentical values. I extract the values using SQL and populate 2
variables and use a for-next loop to create the dropdown. The dropdown
contains some 310 items! It works beautifully if I have 1 or 2
dropdowns but as soon as I add more it partially creates the 3rd and
just stops until it times out!
All 5 work because I have altered their positions but it always stops
part way through creating the 3rd dropdown.

I tried an alternative method by doing away with the variables and
constructing the dropdowns with a 'while' statement reading through
the results of my SQL and got exactly the same problem only 2 and a
bit dropdowns.

Stopping it running after a few seconds or several minutes makes no
difference, it seems to reach a certain point and just stop - no error
messages or anything!

I have tried increasing the resourses in my php.ini file but this also
made no difference.

Can anyone suggest an alternative or a fix?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Maximum Integer Size?
I'm trying to figure out how big integers in PHP can be and am having
some difficulty.

My first idea was to try something like this:

<?
for ($bits=0; (1<<($bits+1)) > (1<<$bits); $bits++);
echo $bits;
?>

The result was 30. This, however, is incorrect as the following
demonstrates:

<?
$num = 1<<30;

echo "num = $num
";
echo 'num<<1 = '.($num<<1)."
";
echo 'num*2 = '.($num*2)."
";
?>

That my first idea would return the wrong result doesn't surprise me,
though, since bitwise operators in PHP are treated as arithematic ones
and not logical ones.

So I came up with another test.

<?
for ($bits=0; pow(2,$bits+1) > pow(2,$bits); $bits++);
echo $bits;
?>

In Windows XP, I got 1024 back. On Linux 2.6.13.2 and 2.4.28 (as
reported by phpinfo), all I get are timeout errors. So I decided to
make my script more efficient and hopefully faster:

<?
$x = 2;
$y = 1;
for ($bits=1; ($x*=2) > ($y*=2); $bits++);
echo $bits;
?>

On Windows XP, I again got 1024 back, whereas on Linux, I again got
timeout errors.

Maximum Size Of Cookie Content
I was wondering if anyone knows whether there is a maximum size limit on a cookie content
If so,

1) Is this a limit per cookie in a single domain? i.e. no single cookie value can exceed XX bytes
2) Is this a limit on all the cookies that get saved under a single domain? i.e. the total size of all the cookies cannot exceed XX bytes
3) Is the limit different from browser to browser?
4) How can I detect what the limit is?

What Is Maximum File Size For .php Files?
I'm currently working on a 56kb .php file, but my (Windows) PHP interpreter crashes very often when displaying the php script in my browser. What is the maximum size for .php files, and is 56kb actually too big? Should I split it up?

How Can I Increase The Import Maximum Size For MySql
I have a requirement for importing a sql file in my local databse.I
have exported the file from the client database.That file is more than
50mb.I want to import this sql file into my local database.My Maximum
import file size showin as 8mb.I tried to change by editing the ini
file.But still it showing the same.I am using phpMyAdmin.Please tell me
the procedure to change the Maximum File Size for Importing sql file.

Maximum File Size That Can Be Handles With A PHP Script
I am currently trying to debug a script written by my predecessor.
Basically I have an HTML form that is used to upload a file that is
then processed using a PHP script. It has been in frequent use but I
have just been contacted because there is a PDF document that is not
uploading.

I reckon it may have something to do with the file size. All the
previously uploaded files are relatively small (<2MB) but this one is
about 5MB. When I try to upload the file using the script, which I know
uploads the file as it has been in use frequently in the past and I
have tested it with other files, it appears to reject it. When I do the
following (before any processing when the form has been submitted):

echo $_FILES['file']['size'];

....it returns zero (0) indicating that something has gone wrong
although when I do the following:

echo $_FILES['file']['name'];

....it returns the name.

I have tried including a hidden HTML form element MAX_FILE_SIZE and
setting it to exceed the file size (in bytes) but still no luck. Could
it maybe be something in the files content?

Session Limit (maximum File Size Of A Session)
We all now that upon calling session_start(), it will create a file and in this file the session variables that you assigned will be stored. My question is how big can a session file can be? is there a limit or maximum file size for a session file?

Dynamic Dropdown And Hardcode Dropdown In Select Form
I have plenty of examples of dynamic dropdown choices but none of hardcoded dropdown choices. The ultimate goal is to have a job with various tasks and to track the status of those tasks for a given job. I've used one of the tutorials here to begin the process. Below is the code I have to add work on a given task. Perhaps I actually need to "Update" a job as opposed to "add".

But the problem of the moment is I can't seem to hardcode one set of my options. This is the code I have: PHP Code:

Maximum Sizes
I have few more questions what is maximum string size, maximum header size for sending e-mails & maximum html e-mail size if we want to send html content in body and set content type tex/html.

How to configure linux server to increase mailbox size so that I can send huge mails. I'm really in a great trouble, It will be of great help to me if any one tells me this maximum sizes and how to handle if maximum size exceeds.

Maximum And Minimum Value
I want to find the maximum and minimum, average value from the text file

<?
$lines = file('./data.txt');

                foreach ($lines as $line) {
                $text_line = explode(":" , $line);


$text_line1 = explode(" " , $text_line[2]);
array_sum($text_line1);
}
?>

This method I am not able to get the array sum..... How to get the numerical value of numbers from strings When I explode the line it is in string format. I should find the array_sum and max() which I values  are in numeric not string.

Getting Maximum Value Inside A Loop
I'm using something like this, to output a table of rows:

// Set max_val
$max_val = 0;
// Do the loop
while ($row = mysql_fetch_assoc($result)) {
$max_val = max($max_val, $row['integer']);
// etc etc
echo $max_val;
// etc etc
}

I want the maximum value of $row['integer'] to be available in every row. The above example does this, with the exception of the first (top) row of the table, where $max_val is then the value of $row['integer'] for that row - not the actual maximum for all rows.

What Is The Maximum Length Of A String?
the php manual gave an example where you can pull an entire file into one string:

$fcontents = join( '', file( 'http://www.php.net' ) );

is there a maximum size that this string can hold, therefore a maximum size file I could import...what happens when this max is reached...error, or just cuts off..?

Using SELECT To Just Find Row With Maximum Value
how do i do a SELECT statment that will just query a table to find the
row with the maximum of a declared field. for example, if i have a
table of customers and i would like to get the value of the last
customer to register so the SELECT statement would return only one
row, how would i do this?

also, the plan i have is to use a while loop (coz i dont know any
other) to get the colum value of each row:

$select = "SELECT ...
$result = mysql_query($select, $conn); //$conn will be predefined in
the code
while ($row = mysql_fetch_array($result)) {
$date_added = $row['date_added'];
}

the while loop makes sense when outputting many rows but to get the
value of one column in one row, i dont know. it just seems a little
inefficient to use a while loop when i know there is only one row
returned (or will know), is this how all rows from a select statement
are queried or is there a more efficient way of doing this for this
situation?

Maximum Characters In Variables?
My concern now is that I am putting a lot of info into arrays. Is this a bad way to proceed? Or should I use a way to simply include() the file instead of loading it into a variable and printing it to screen? The reason why I have it in an array is for reading different parts of the file... But I can fix it to use the include() function for the heavy parts...

Right now I am storing the same data into a database I downloaded MySQL, made the database and tables and all I need to do is insert the info... But that's another thing. I wanted to not use a database because it will save money for hosting. The site isn't going to be very big (guessing only 50 pages) so I can use only PHP.

Finding Sums Of Two Numbers Under Maximum Value
I have two, or more, numbers and a maximum value. I need to find a way to calculate all unique combinations of those numbers whose sum is less than or equal to the maximum value.

For example:

First Number: 6
Second Number: 8
Maximum value: 30

Possible sums:
6, 12, 14, 16, 18, 20, 22, 24, 28, 30
(how I calculated those sums is listed at the end of the message)

If anyone could give me some suggestions that would be fantastic.

peer

// Calculated Sums
6 * 1 = 6
6 * 2 = 12
6 * 3 = 18
6 * 4 = 24
6 * 5 = 30

8 * 1 = 8
8 * 2 = 16
8 * 3 = 24;

6+8=14
6+16=22
12+8=20
12+16=28
18+8=26

Maximum Lenght Of Select Statement
Can anyone tell me what the maximium length of a SELECT statement can be. I am coming from Foxpro where 8100 char was the limit. Part of my program is a query builder and I need to build a query from a series of drop down lists users select values from.

Maximum Execution Time - 30 Seconds?
I'm writing a script that will pour over 30,000 records into my MySQL database, but PHP is bugging out and stopping after just 30 seconds....Only about a quarter of my records are getting put into the DB - is there a way I can temporarily modify the limit to this execution time, and then switch it back later if I need to?

Fetch Maximum Amount Of Chars
I want to fetch a maximum amount of chars, 10 in this case, from my mysql dbase with php. For example: If there is 'Post new topic for forum' in the table, I want to output it to the screen like this: 'Post new..'

Maximum Upload Limit Reached
Hi there I have a form on my website that can allow people to upload files via a web page.
I have the MAX_FILE_SIZE value currently set at the default of 2mb. What I would like to know is, when I am uploading the files what is the easiest way to spit out an error message if the maximimum upload limit gas been reached?

Currently it just goes to a refreshed upload page, but does not inform the user that the limit has gone over. Does anyone know the easiest way to do a check for this and then if it is more than they are allowed inform them??

Define The Maximum Result Record
I would like to define the maxmum record that are shown after a search.

Say the total result has 20000 records

I want the result page show only the first 50 out of the 20000, and ignore the rest.

I heard someone say i could "Change the SQL to "SELECT TOP 50...."
I'm not sure how to do that, can anyone help? ....

Maximum Load Time Exeeded..
I know exactly the problem... Basically I changed my method from displaying tutorials per 1000 characters, to adding a function in my bbcode to manually make a "new page". Code:

Maximum Image Height And Width
I have a form where a user can upload a file. s there a way to check the height and width and if the the dimensions fall within a certain criteria the image is uploaded? If not uploaded I want to display and error. I would like images to be no greater than 80 pixels wide by 120 pixels tall.

Catch The Maximum Execution Time Error
I have tried to code a script that allows user to upload a C source file, then compiles and runs.

When i execute the compiled file, i want to impose it a time limit and if the limit exceeded, print " Time limit exceeded".

<form method="POST" enctype="multipart/form-data" action="<?= $PHP_SELF ?>">
<input type="file" name="fn" size="49">
<input type="submit" value="Upload" name="B1" style="button">
</form>
<?php
function excess($errno, $errstr, $errfile, $errline)
{
print "Time limit exceeded";
}
$fn=$_FILES['fn'];
$max=204800;
if (is_uploaded_file($fn['tmp_name'])) {
move_uploaded_file($fn['tmp_name'],"test.cpp");
print "<p>Compiler feedback </p>";
if (is_file("new")) unlink("new");
if (is_file("a.out")) unlink("a.out");
passthru("g++ test.cpp 2>new");
if (!$f=fopen("new","r")) {print "error";}
else {
while (!feof($f)) {
$s=fgets($f);
echo($s);
}
fclose($f);
}
unlink("new");
if (is_executable("a.out")) {
print "<p>Time limit is 60 seconds </p>";
set_time_limit(60);
error_reporting(E_ALL);
set_error_handler('excess');
passthru("./a.out >new");
if (!$f=fopen("new","r")) {print "error";}
print "<p>Your program output </p>";
while (!feof($f)) {
$s=fgets($f);
echo($s);
}
fclose($f);
} else {print "<p>Cannot compile your program </p>";}

}
else {echo "Submission failed";}
?>

it seems like the passthru is not imposed any time limit and the script always ends regardless the source file.

Maximum Execution Time Of 30 Seconds Exceeded
I need to process every character in a file, so i open the file read
in buffers of about 8192 bytes and process each buffer, then i write
the output to another file.

the problem is that with large files(>8Mb) i get a script error(Fatal
error: Maximum execution time of 30 seconds exceeded ).

I acess every character in the buffer with
$chr=ord($bufferIn{$i}); (where $i=0...8192)
seems like all he time the script consumes is in the for loop and the
chr/ord functions.

can i do something to speed things up?
is there any other way of acessing a single characher except $bufferIn{$i}?

Setting A Maximum Limit On A Php/mysql Result?
I am using PHP and MySQL to do this script. I want to have a table that contains only numbers for data and then add them all up as a result to display and that I have accomplished with no problem and then I want to display a percentage of that number to the public however that also I have accomplished with no problem using round()...

The problem is I am trying to set a maximum number that it displays.

I want it to display 1-500 no matter what the number is or the decimal it may have is provided it doesnt exceed 500 but once it does I want it to display 500 as the limit so even if it is say 674 I want it to only display 500. How would I go about doing this?

The sql I am using for the adding is SELECT SUM which works just fine and I am using round( $total_number *.15, 2) to display the percentage number of 15%.

How To Remove Oldest Field After Maximum Fields ?
Members of my site have a personal guestbook. I want to give them space for 100 comments. How can I achieve that if item 101 is posted, the oldest is being removed so that 100 items stay in the db ?

the mySQL table PersonalGuestbook:
pgID
pgName
pgComment
pgOwner

FATAL ERROR:Maximum Execution Time Exceeded
I really would like to focus on the business solution this app is supposed to achieve, but there always seems to be a problem with either PHP or MySQL. I finally got everything installed and talking to one another, but now I get this error - Fatal error: Maximum execution time of 30 seconds exceeded in Unknown on line 0.

All I am doing is testing the database connection. The table I am querying has one row of data and I am asking for only one value from that row. The query always takes 30 seconds. I am running this query on my local machine. I am not traversing the net or anything.

Here is the code I am using . I pass in one value called login, to this page :

$cnx=mysql_connect("server:/tmp/mysql.sock","user","") or die(mysql_error);

mysql_select_db("database")or die(mysql_error);

$qry="select SSL from SysUser where username="."'".$login."'";
echo $qry."<br>";
$recset=mysql_query($qry);

while($row=mysql_fetch_object($recset))
{
$ans=$row->SSL;
echo 'SSL= '.$ans;
}

Please help me debug this speed issue.

Maximum Execution Time Of 60 Seconds Exceeded ,how To Solve It?
Fatal error: Maximum execution time of 60 seconds exceeded in H:xampplitehtdocsmlmcardstore.php on line 62

how to solve it?
duno why sometime the browser hang in there....then cause this error msg.

Maximum Execution Time Exceeded // Recursive Function
I am trying to run a recursive function until I quit. But after 30 seconds I get:

Fatal error: Maximum execution time of 30 seconds exceeded

Anyway around this so my function can keep going?

Fatal Error - Maximum Execution Time Of 30 Seconds Exceeded
What could be the cause of this error?

Fatal error: Maximum execution time of 30 seconds exceeded in ht*p://localhost/search.php on line 7

The search.php is an included file. I get this error during the first instance the page is accessed. However, succeeding access does not procedure this error anymore.

The code for search.php (up to line 7) is below:

Maximum Execution Time Of 30 Seconds Exceeded In Creating Thumbnails
I am trying to create thumbnails from 2500 pictures. But I always get
a Maximum execution time of 30 seconds exceeded" at the statement with
the method with imagejpeg or imagedestroy after processing and
creating 500 thumbnails.

Is there anything I can do to avoid this error?

Fatal Error: Maximum Execution Time Of 30 Seconds Exceeded
I'm running a simple mail script on a WinNT server. It gives me the following error:
Fatal error: Maximum execution time of 30 seconds exceeded in E:intranetphone.php on line 22 It does send the email though. Code:

Maximum Execution Time Exceeded With A Mysql Query In A Loop
My script inserts a huge amount of rows to a mysql table and just as easy it deletes them, so to optimize the index numbers i'm trying to make it so that when i'm adding new rows it searches for an empty one to add the new one in.
It's a phpbb mod i'm writting. This is the code i'm trying: Code:

Fatal Error: Maximum Execution Time Of 30 Seconds Exceeded
Im (still) building my stats builder. After much battling I have finally got my code to read in the server log file line by line in reverse without commiting the whole log file to memory by reading the whole thing (if it did the server woul die as the files are HUGE). Once each line has been read the php passes this info to the mysql to be picked up at a later point.

It all works fine, and im happy with my progress.

The only problem? It exceeds the maximum execution time and just stops working! How can I solve this? Is there a way to set the server to let one file run over the 30 secs, or is there a problem in my code??

Fatal Error: Maximum Execution Time Of 30 Seconds Exceeded
I make a code to display numbers 1-20 randomly without repeating any of the numbers. The result is fine but I keep on getting Fatal error: Maximum execution time of 30 seconds exceeded. Personally I don't think PHP will have much trouble going through the loop. Here's the code:

Looking For Dropdown Help
I have a dropdown in which i want it to open a soundfile when selected. So, how do I go about this. The form will get submitted, and through a series of conditional statements it will point the right selection to the right if statement. but what do I put in the if statement to get it to open a realplayer with my ram file?? Here's what I got so far.
Code: <FORM ACTION="<?=$_SERVER['PHP_SELF']?mode=changedropdown?>" METHOD="POST" NAME="sermondropdown">
<P>
<SELECT NAME="sermons" SIZE="1" onchange="this.form.submit();">
<OPTION VALUE="pleaseselectasermon">Please Select a Sermon
<OPTION VALUE="082403Daniel_1_1-8">August 24, 2003 Daniel 1:1-8
<OPTION VALUE="083103Daniel_1_1-8">August 31, 2003 Daniel 1:1-8
</SELECT></P>
</FORM>

<?
if('changedropdown' == $_GET['mode']) {
$selection = $_POST['sermons'];
if (?Daniel_1_1-8' == $selection) {

} elseif (?Daniel_1_1-8' == $selection) {

}
?>

Dropdown
I have a dynamic drop down that needs to be populated from different columns in a database. The problem I'm running into is that sometimes fields do not have a value. So I would rather those didn't print out. The code below prints out the blank fields.

I know I need to loop through and check for an empty value, but I'm drawing a blank on the how part. Code:

Dropdown Possible With PHP ?
i'm looking for a way to do the following :

1. selecting data from a MySQL database
2. putting one field into a dropdown
3. after selecting a value from the dropdown follow some more php code

step 1 is no problem, step 2 is no problem with the html select statement however this leaves me on the client side. After this i'm not able to return to the server side to execute some more php code, with the onchange attribute i can start some javascript but i want ( read need ) to use php code. Concrete question : is there a way to create a dropdown in pure php code ?

Dropdown Box
I currently have a dropdown box on a page. What I would like is that when a user selects something from the dropdown box it automatically changes the display of another box.

Value In A Dropdown
I have a piece of code where I get the player_id value from the url at the top of the page. Rather than this I want to get the value from variable named $player_one. Code:

Dropdown Box And A Query
Heres my situation:

In a form I want to read the categories listed in table $inv_table and present them in a dropdown window so the viewer can choose and add to a different table. The script below works with one glitch. There is a huge white space on the page above the dropdown box. This will get me by but it isn't too purty.

<td valign="bottom">
<a name="theform">
<select name="catname" size="1">
<?
{
$result = mysql_query("SELECT DISTINCT category FROM $inv_table ORDER by category",$db);
while ($myrow = mysql_fetch_array($result))
{
echo "<option>".$myrow["category"]."</option><br>";
}
}
?>
</SELECT>
</td>

Dropdown List
I have a Dropdown list with Select with 1, 2, 3, 4, after select on of them it bust to refresh the page to what you select but it don't do it. PHP Code:

Dropdown Menu
I want to upload a feild values into a dropdownmenu. can anyone help me how to write in php code.

Dynamic Dropdown?
I am posting a code for dynamic dropdown by Leon Atkinson, it works fine but i have a doubt: I tried to add another functionality to it where i got stuck! Once the city also gets selected from the second drop down i wanted that on clicking the submit button it should go to some html page wrt to the city choice. Code:

Dynamic Dropdown Box
im looking to have two drop down boxs one with makes of car and
the second drop down box to automatically populate with all the model
of that particular make of car. there are about 50 makes and upto 50
models per make.

I just would like to know the best way to do this - javascript or use
a database? it would be a lot of code todo it in javascript wouldnt
it?

Dropdown - Default Value
I want to be able to have a drop down list that doesn't necessarily have the first item as the default. The content is being populated by PHP so I have no idea how to do it.

Dropdown List
i am trying to get two dropdown lists working on a page. How do i go about this. For example, I have 1 table which holds countries and cities. When a user selects a country in the first dropdown list, i'd like the second dropdownlist populate with a list of cities etc. from my database.

Php Dropdown - Selected?
i'm using this to pull information from a database and display it in a dropdown list. The problem is I am using the name code when I goto the "Update" page, but i'm not sure how to add the "selected" field, that way what ever I saved in the database will load.

Example: I goto add and it add's the "id" of 7 to the field, when I load the page again it auto's back to 1 instead of clicking in-to 7 as thats whats already there... = ) Code:

MySQL Dropdown
Is there a way to make a dropdown by getting the options directly from the database? And I'm using this as a form so it has to have a name so I can call upon the value and do something to it.

Example to what I want to do:

- I have a database table named members and in that table, it has 3 columns - name, age, sex.

What I want to do is make a dropdown inside a <form> using the data from the database. And then when the person selects the name of the member and presses submit, it deletes the row with that name from the table and the database.

Change Dropdown Value
i've two dropdown fields

1) products - (mobile phone, camera, webcam, tv, dvd player and etc
2) accessories

how accessories field can be changed if visitor selects product.

for example: if visitor selects TV, accessories field should automatically changed with cable wire, electric board and etc (without reloading)

another example is www bestessays com/order.php
when you'll select "Thesis" from type of document, urgency and cost per page values will be changed.


Copyright © 2005-08 www.BigResource.com, All rights reserved