Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-08-2006, 04:03 PM
Red Blaze's Avatar
Red Blaze Red Blaze is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Fatal Error, time exceeded.

I get a Fatal Error Maximum execution time of 30 seconds exceeded on line 19.

Code:
while($counter <= count($photos_uploaded)) {
 if($photos_uploaded['size'][$counter] > 0) {
   if(!array_key_exists($photos_uploaded['type'][$counter], $photo_types)) {
     $result_final .= 'File ' . ($counter + 1) .
       ' is not a photo<br />';
   } else {
     // Great the file is an image, we will add this file
   }
 }
}
That's the block of code that starts at line 19. Any way I can make the code simpler so that it won't exceed the 30 second execution limit?
Reply With Quote
  #2  
Old 02-08-2006, 05:29 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

don't allow to much photo uploads at the same time
Reply With Quote
  #3  
Old 02-08-2006, 06:25 PM
Red Blaze's Avatar
Red Blaze Red Blaze is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oddly enough, not even one will go through.

I downloaded a file that was already done, from the tutorial I was reading and it works just fine. I must of missed something.

Ok, the uploading works well already. Granted, I still need testing with it. But here's the viewgallery page.

http://www.pro-photos.com/uploading/viewgallery.php

If you give it time, or maybe right off the bat, you'll get errors. In a short time, they'll go away and it'll be as if they were never there. In time, they'll show up again. Why does that happen? I really don't understand.
Reply With Quote
  #4  
Old 02-08-2006, 06:46 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Increment your counter.
Reply With Quote
  #5  
Old 02-08-2006, 07:31 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oops ^^

right, you are not incrementing the counter variable, so it's an endless loop
Reply With Quote
  #6  
Old 02-08-2006, 08:15 PM
Red Blaze's Avatar
Red Blaze Red Blaze is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

uh huh. o.o;
Sorry, that's one thing I'm not sure how to do. Here's my block of code:

Code:
		$result = mysql_query( "SELECT c.album_id,c.album_name,COUNT(photo_id)
						FROM gallery_albums
						WHERE customer = '".$customer."' as c
						LEFT JOIN gallery_photos as p ON p.photo_album = c.album_id
						GROUP BY c.album_id" );
line 27->		while( $row = mysql_fetch_array( $result ) )
		{
			$result_array[] = "<a href='viewgallery.php?aid=".$row[0]."'>".$row[1]."</a> "."(".$row[2].")";
		}
line 31->		mysql_free_result( $result );
Right now, it's giving errors saying:
Quote:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/prophot/public_html/uploading/viewgallery.php on line 27

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/prophot/public_html/uploading/viewgallery.php on line 31
But if I take off "WHERE customer = '".$customer."'", the errors go *poof*. I want to filter the albums by customer so only THAT logged in customer views his/her albums and not anyone elses. <=/
Reply With Quote
  #7  
Old 02-08-2006, 11:21 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The query probably failed (and certainly did given it's not syntactually valid).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:09 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04016 seconds
  • Memory Usage 2,214KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete