RE: [PHP-DB] Maximum execution time of 30 seconds exceeded
Why is it important that you recycle old PINs? This is most likely eating up the most time in your script execution. My suggestion would be to either A) just keep creating a new one and ignore ones when a child leaves or B) create a 2nd, much smaller table available_pins and when a child leaves, insert their former PIN into this table. Then upon executing the new student script, you check the available_pin table for rows 0. If so, use the first one. If not, give them a new one. Good luck. -M -Original Message- From: Michael Cortes [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 2:57 PM To: Ben Lake Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Maximum execution time of 30 seconds exceeded I do have an auto_increment for the record id. But that is just a way for me to uniquely id the record. Student numbers, barcodes, etc can change. The reason I am using the do/while loop is: Every student is getting a 4digit pin for library, cafeteria and network access. It has to be unique and we have been assigning a different range of numbers per building/grade. There are various procedural reasons for this. I have verified that I am identifying the new student correctly and going into the do/while loop with a variable that holds the correct starting number for the appropriate pin range. It's then just a matter of trying consecutive numbers till I find an available pin. The pin may be available because a student left the school or because it's next available at the end of the line. Anyway, I was not aware I could pick and choose my ranges in an AUTO_INCREMENT field. I appreciate any thoughts you may have. Thanks. On Monday 11 August 2003 02:41 pm, you wrote: Why don't you use an AUTO_INCREMENT field in your table to define a unique number? Ben -Original Message- I had a do while loop such as do { mysql_query ($qupdate, $link); $rslterror=mysql_error($link); $number++ } while ($rslterror!=null); Anyway, I fixed my dumb mistake. If anyone would like to help me with a better one, maybe you can tell me if I am doing my do while correctly. It's only running through once, not getting a succesful insert and dropping out. Thanks -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Renaming .htm pages to .php
If you change you Apache configs, it wouldn't create a problem with .htm pages that don't use any PHP, but the pages will still be sent through the PHP parser. If you don't have a very high-traffic site and there's no other sites on the box, then you probably won't see any real performance hit - but understand that if you do start getting a ton of traffic, every .htm page will be parsed for PHP content. Even if none is found, there is some CPU cycles burned in that initial parsing. -Original Message- From: David Blomstrom [mailto:[EMAIL PROTECTED] Sent: Sunday, August 03, 2003 9:49 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Renaming .htm pages to .php So if I understand you correctly, I can turn a page into a .php page through one of two methods: 1. Change the extension to .php 2. Instruct Apache to treat .htm extensions as .php extensions. That sounds really interesting. Would that create any problems with pages that I never use .php functions on? Or if I have websites on my computer that don't use php? Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Session error?
Just put the full path of the dir. For instance I placed mine at C:\php\session to keep things separated. -M -Original Message- From: Tim Winters [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2003 12:31 PM To: 'CPT John W. Holmes'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Session error? Thanks John, So is that address relative to the physical machine or is it relative to the directory where the php files are contained. Tim Winters Creative Development Manager Sampling Technologies Incorporated 1600 Bedford Highway, Suite 212 Bedford, Nova Scotia B4A 1E8 www.samplingtechnologies.com [EMAIL PROTECTED] [EMAIL PROTECTED] Office: 902 450 5500 Cell: 902 430 8498 Fax:: 902 484 7115 -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: June 23, 2003 11:40 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Session error? Warning: session_start() [ http://www.php.net/function.session-start function.session-start]: open(/tmp\sess_bf0c0a0a020087aa573e357a2553f828, O_RDWR) failed: No such file or directory (2) in C:\Program Files\Apache Group\Apache2\htdocs\MailOrderDynamic\c.php on line 6 The default session.save_path in php.ini is set to /tmp. It appears you're on a windows machine and probably do not have a c:\tmp directory. Either create one (if that's where you want to store your session files) or change the path in php.ini to some other folder that exists. Ensure the Apache user has permission to write to the folder you specify, also. The other errors are caused by the output of your first error. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Renaming all pages to .php
You can easily add the .php extension to any .htm(l) page that you have with no worries as long as you have PHP installed and configured properly. The only problem is that page load will be SLIGHTLY slower since PHP will search all .php pages for PHP code to evaluate. Upon finding none, it will simply return the HTML to the requester. But note that this is a tiny bit longer than your web server just serving the page without passing it through PHP. Naming all files index.XXX will be a good idea. Though realize that some people might link directly to the file itself (which can sometimes become visible with different browsers and different activities). But none-the-less, it will work for most users if they do decide to bookmark the folder. -M -Original Message- From: David Blomstrom [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 10:14 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Renaming all pages to .php I'd like to get some feedback from this forum. Do you agree that a page without php functions or server side includes can be put online with either a .htm or .php function? If I never add a php function to a page with a .php extension, could that cause some kind of problems? Also, I'm thinking of naming all my pages index and sticking them inside folders. That way, visitors can reach a page by typing in www.geobop.com/birds/ , whether the full URL is www.geobop.com/birds/index.htm or www.geobop.com/birds/index.php Is this a good plan, or do you see any problems? Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Resize pictures and store with MySQL
Just to illustrate how you'd go about doing this: - User uploads image description - You resize image with GD functions (look at imagecopyresized()) - Store URL and description to the mySQL table you made It's a very simple thing to do once you organize your file structure where you're going to be storing the images. To retrieve them, you just need to know the image's ID and query based upon that. From there, you can access the image's URL or caption as you need. You can very easily create a script to display the images by querying the DB for X entries and displaying them per page. What you're basically describing is the functionality that MANY blogs have. You can probably find some free scripts online with a minimum amount of searching. -Mike -Original Message- From: Frank McIsaac [mailto:[EMAIL PROTECTED] Sent: Sunday, March 30, 2003 12:26 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Resize pictures and store with MySQL Hi. I want to use PHP and MySQL to help make it easier to put pictures on a website. What I want to do is make a page that allows the client to submit a picture (or a bunch of pictures) and a caption for each picture to me via a form of some sort. Then, once the file gets here, I would like it to resize the photo to a preset size and store it with it's caption. Is this possible? If so, is there also a way to get php to dynamically design a web page with each of these photos (complete with their captions) on it? I am using PHP 4.2 and MySql 3.23. Thanks in advance for any help. Frank -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php