Unregistered Avatar

Reply

vb loops & variables


 
LinkBack Thread Tools Display Modes

  #1 (permalink)  

Old 11-18-2004, 03:36 PM

vb loops & variables

helping jd- with looping through sql data and variables...

PHP Code:
// Hum, Hum  vb vars =/
$DB $DB_site;
//get query vbulletin style.....

$query $DB->$query("select * from "TABLE_PREFIX ."affiliates ORDER BY id");
while(
$results $DB-> fetch_array($query))
{
$tablecontents .= "<tr><td> $results[name] <td><td> $results[link] </td></tr>";

Okay so thats some pretty easy php that loops through every affiliate entry and outputs the name and link into a 2 column table.... now lets build our template....

HTML Code:
<html> <head> </head> <body> <table>
    $tablecontents
  </table> </body> </html> 

Now to finish off the php code.. heres the eval part on the php page:

PHP Code:
//grab template named 'affiliate_template'
 
eval('print_output("' fetch_template('Affiliate_Template') . '");');
?> 
__________________
Audi Videos | MySpace Layouts | About Me

missionsix is online now loves you.

missionsix's Avatar

Join Date: Feb 2004

Location: under you.

Posts: 4,774

Send a message via AIM to missionsix Send a message via MSN to missionsix
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vb 3.0.5 upgrade complete missionsix Discussion Lounge 5 01-10-2005 09:18 AM


All times are GMT -7. The time now is 03:29 PM.