vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Too strange, I starting to give up (https://vborg.vbsupport.ru/showthread.php?t=78996)

Koutaru 03-29-2005 06:54 AM

Too strange, I starting to give up
 
This is the strangest thing I've ever seen. A .php which was working earlier now doesn't work and backups won't help either.

Basically, the file won't open. There is no 404 error, it simply won't display and eventually, timeout.

If I change the code
PHP Code:

$getstocks $DB_site->query("SELECT stockname,symbol FROM ".TABLE_PREFIX."stocks WHERE active=1 ORDER BY symbol"); 

to (very small change, get rid of the _first)

PHP Code:

$getstocks $DB_site->query_first("SELECT stockname,symbol FROM ".TABLE_PREFIX."stocks WHERE active=1 ORDER BY symbol"); 

The file actually opens. However, the next line fails to work:

PHP Code:

while ($stock $DB_site->fetch_array($getstocks)) 
{
#MORE CODE HERE


Even though it looks perfectly fine. This exact code appears again exactly in another DO request and works fine but this one....

I'm starting to think it's server related but why this would happen on the server is beyond me. It's really puzzling and sinve I've spent hours over this, I'm at my wit's end.

Help?

Deaths 03-29-2005 07:02 AM

If you use while, you can't use query_first ;)

Now, since you're gonna use while, the ORDER BY can be dumped, we can re-apply that later.

So, try this:
PHP Code:

 $getstocks $DB_site->query("SELECT * FROM ".TABLE_PREFIX."stocks WHERE active=1"); 

That should do, tell me if not.

Koutaru 03-29-2005 07:06 AM

:) thanks for telling me. That makes sense. The only thing is, if I do just query, the file won't load period and it'll eventually time out (I've tried the above code too).

[slumps] It only will load with query_first. Very, very odd.

Marco van Herwaarden 03-29-2005 07:23 AM

Could you post the table definition.

Guest190829 03-29-2005 07:32 AM

Is this from AN-net's Stock Hack?

tnguy3n 03-29-2005 07:58 AM

if you use'
Code:

$getstocks = $DB_site->query_first("SELECT stockname,symbol FROM ".TABLE_PREFIX."stocks WHERE active=1 ORDER BY symbol");
then,
PHP Code:

while ($getstocks)
{
#MORE CODE HERE



Koutaru 03-29-2005 08:23 AM

Quote:

Originally Posted by Danny.VBT
Is this from AN-net's Stock Hack?

Unfortunately, that also sends it into a timeout

And yes, it is from AN-net's stock hack

I've also tried inserting just another query_first infront of the regular query to see if query_first is required but that fails as well.

However, when used, the query works fine, that's not an issue.


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02057 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete