vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   how to fetch many rows from mysql (https://vborg.vbsupport.ru/showthread.php?t=70381)

Lionel 10-09-2004 05:41 PM

how to fetch many rows from mysql
 
Could someone please help fix the below? It is returning only one row. Thank you

PHP Code:

// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 

$postinfos $DB_site->query("SELECT * FROM post WHERE award=1 and visible=1 ORDER BY dateline DESC");
$award = array();
while (
$postinfo $DB_site->fetch_array($postinfos))
{
exec_switch_bg();

$postid $postinfo['postid'];
$tid $postinfo['threadid'];
$uid $postinfo['userid'];
$date $postinfo['dateline'];
$username $postinfo['username'];
$title $postinfo['title'];    
mysql_free_result($postinfos);
}

$threads $DB_site->query("SELECT * FROM thread WHERE threadid=$tid");
$threadid = array();
while (
$threadinfo $DB_site->fetch_array($threads))
{
exec_switch_bg();
$ttitle $threadinfo['title'];
$forums $threadinfo['forumid'];
mysql_free_result($threads);
}
$theforums $DB_site->query("SELECT * FROM forum WHERE forumid=$forums");
$forumid = array();
while (
$foruminfo $DB_site->fetch_array($theforums))
{
exec_switch_bg();
$forum $foruminfo['title'];
mysql_free_result($theforums);
}
construct_forum_jump(); 
$navbits = array(); 
$navbits[$parent] = 'Editor\'s Pick'

$navbits construct_navbits($navbits); 
eval(
'$navbar = "' fetch_template('navbar') . '";');

eval(
'print_output("' fetch_template('pick') . '");'); 


Velocd 10-09-2004 06:43 PM

Mind explaining what you are trying to do? ;)

As a general reminder on the forums, remember to post more specific details of your problem for a large chuck of code before assuming members will just instantly clue in. (especially when the code chunk isn't indented or formatted properly for readability)

Lionel 10-09-2004 06:53 PM

I am trying to fetch the users who receives an award (from the awards hack) to display the post name in a different page, with a link to that awarded post, the user and his id, the thread name and the linked forum

Lionel 10-09-2004 11:27 PM

here is an image of what I am desperately trying to achieve here and then click on thumbnail

Colin F 10-10-2004 02:55 PM

Just glancing over your script, you're missing calling any template.

You'll have to call a template with .= for each run through you make while fetching the array. That'll add the new data to the variable. Then, insert the variable in the main template.

Make sure you have both templates set up :)

Lionel 10-10-2004 02:59 PM

thanks for replying. Coincidentally I finally got it 5 minutes ago by altering another hack.


All times are GMT. The time now is 10:48 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.01188 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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