Jump to content

Programming a Forum


MemphiS

Recommended Posts

Could some users with experience provide smoe examples on how they access thier mysql data to display to the user.

 

I currently use the following method:

 

<?php
$forum = mysql_query("SELECT `id` , `topic_by` , `topic_header` , `date` FROM `forums` ORDER BY `date` LIMIT 0,30");
while ($getForum = mysql_fetch_row($forum)){
echo("<tr><td><a href='viewforum.php?view=$getForum[0]'>$getForum[2]</a> by $getForum[1] on $getForum[3]</td></tr>");
}
?>

 

Also i have replys showing the users posts, topics made and an image like this forum.  This lags the load time huge and i would like to improve it.

 

Just looking to improve load times.. =) Thanks

Link to comment
Share on other sites

<?php
$forum = mysql_query("SELECT `id` , `topic_by` , `topic_header` , `date` FROM `forums` ORDER BY `date` LIMIT 0,30");
while ($getForum = mysql_fetch_assoc($forum)){
echo("<tr><td><a href='viewforum.php?view=".$getForum["id
"]." '>".$getForum["topic_by"]."</a> by ".$getForum["topc_header"]." on ".$getForum["date"]."</td></tr>");
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.