What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » I need PHP/MySQL help again

I need PHP/MySQL help again
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
O.P. Huh?  I need PHP/MySQL help again
[Image: attachment.php?pid=376033]
Above is a picture of the mysql database.

What I am trying to do is print out each entry in order according to the NewsNum. The while statement I am using just prints out each row from the first in the image to the last.

code:
$i=0;
while ($i > $num) {
    //Print out news entries
    $i++;
}

If anyone can come up with a better way to do it please let me know.

code:
$i=$num-1;
while ($i >= 0) {
    $j=0;
    while ($j != mysql_result($result,$i,"NewsNum")){
        $j++;
    }
    echo ("<table border='0' width='421' id='table1' cellspacing='0' cellpadding='0'><tr><td width='2%' rowspan='2' background='images/border.gif'>&nbsp;</td><td width='2%' rowspan='2'>&nbsp;</td><td width='71%'><font size='1' face='Verdana'><b>");
    echo mysql_result($result,$j,"NewsTitle");
    echo ("</b></font></td><td width='27%'><font size='1' face='Verdana'><b>");
    echo mysql_result($result,$j,"NewsDate");
    echo ("</b></font></td></tr><tr><td colspan='2'><font size='1' face='Verdana'>");
    echo mysql_result($result,$j,"NewsStory");
    echo ("</font></td></tr></table><br>");
    $i--;
}

That is how i found the way around it.

.gif File Attachment: phpMyAdmin.gif (9.87 KB)
This file has been downloaded 166 time(s).

This post was edited on 02-07-2005 at 12:54 AM by matty.
02-07-2005 12:18 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
I need PHP/MySQL help again - by matty on 02-07-2005 at 12:18 AM
RE: I need PHP/MySQL help again - by WDZ on 02-07-2005 at 04:35 AM
RE: I need PHP/MySQL help again - by Ahmad on 02-07-2005 at 06:05 AM
RE: I need PHP/MySQL help again - by Eljay on 02-07-2005 at 07:48 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On