hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Quick PHP problem
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Quick PHP problem

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-21-2002, 10:40 PM
NickMahon NickMahon is offline
WHT Addict
 
Join Date: Apr 2002
Posts: 112

Quick PHP problem


PHP Code:
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<?php
$link_id 
mysql_connect( [ None of your business!! ] )
mysql_select_db("nmahon_nmahonsanctuary"$link_id);
$i 1;
$result mysql_query("SELECT topic_time, topic_id, topic_title FROM `phpbb_topics` ORDER BY `topic_time` DESC LIMIT 10");
$result2 mysql_fetch_row($result);
while(
$i 10) {
    if(
$i%2!=0){
        
$class "row1";
    } else {
        
$class "row2";
    }
?>
<tr>
<td class="<?=$class?>">
<a href="viewtopic.php?t=<?=$result2[1]?>"><?=$result2[2]?></a>
</td>
</tr>
<?php
}
?>
</table>
Hello,

This code is supposed to grab the 5 latest topics from phpBB, arrange them in a table, and link to them.

It seems to be an infinate loop: http://www.vereor.com/sanctuary

Thanks,
Nick

__________________
- Nick Mahon
Vereor.com
Professional Web Development

Reply With Quote


Sponsored Links
  #2  
Old 09-21-2002, 10:46 PM
ffeingol ffeingol is offline
Community Guide
 
Join Date: Jun 2001
Location: Earth
Posts: 1,247
Nick,

You're not incrementing $i within the while loop .

Frank

__________________
Umbra Hosting
cPanel | Softaculous | CloudLinux | R1Soft | Ksplice
Web Hosting, Reseller Hosting, VPS, Dedicated Servers, Colocation
UmbraHosting.com

Reply With Quote
  #3  
Old 09-21-2002, 10:47 PM
NickMahon NickMahon is offline
WHT Addict
 
Join Date: Apr 2002
Posts: 112
Here's another:

Now it returns 10 of the same topic.

__________________
- Nick Mahon
Vereor.com
Professional Web Development

Reply With Quote
Sponsored Links
  #4  
Old 09-21-2002, 10:50 PM
NickMahon NickMahon is offline
WHT Addict
 
Join Date: Apr 2002
Posts: 112
Figured it out, with Frank's help.

Thanks

__________________
- Nick Mahon
Vereor.com
Professional Web Development

Reply With Quote
  #5  
Old 09-21-2002, 11:47 PM
Acronym BOY Acronym BOY is offline
Web Hosting Master
 
Join Date: Mar 2002
Location: Westbury, LI NY
Posts: 1,705
Whoa.

I clicked the link to see how it was looking and thought it looked really sweet, but wasnt sure if it was custom or a template. Than I looked at the domain and than looked at the poster here.

You do nice work Nick!

Reply With Quote
  #6  
Old 09-21-2002, 11:49 PM
NickMahon NickMahon is offline
WHT Addict
 
Join Date: Apr 2002
Posts: 112
Thanks Now if only I could solve the PHP problem in my other thread

__________________
- Nick Mahon
Vereor.com
Professional Web Development

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Eight Reasons Why Hosting Companies Fail Blog 2013-04-18 10:00:57
How To Deliver Products Customers Will Pay For with David Koston - HostingCon 2012 Web Hosting News 2012-07-18 10:46:16
ICANN Application Bug May Push New gTLD Reveal to June Web Hosting News 2012-04-30 11:28:04
WHIR Demo: Parallels Plesk Panel Whir Tv 2012-03-06 18:07:47
Profiting From Domains for Web Hosts, with Christoph Donnemiller of PartnerGate Web Hosting News 2011-10-27 18:52:21


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?