"Shawn Wilson" <shawn@glassgiant.com> wrote in message
news:401FC518.11934FE3@glassgiant.com...[color=blue]
> Marco wrote:[color=green]
> >
> > Hi there ;)
> >
> > Im building a MySQL table for a menssaging system, its a table that has[/color][/color]
3[color=blue][color=green]
> > fields de UserID, MTime and Mess.
> > My problem is that i cant find a way that using only a mysql query i get[/color][/color]
the[color=blue][color=green]
> > time and the message, and that for each row.
> >
> > Basicly the code would look like this, to give an idea...
> >
> > <?php
> > $News=mysql_query("SELECT MTime,Mess FROM Star_Mess WHERE UserID =[/color][/color]
'$UID'[color=blue][color=green]
> > ORDER BY MTime DESC");
> > while ($line = mysql_fetch_array($News, MYSQL_ASSOC)) {
> > foreach ($line AS $Date) {
> > print "\t\t<p><b>$Date</b></p><p>$Mess</p>\n";
> > }
> > }
> > ?>[/color]
>
> I think this should work:
>
> while ($line = mysql_fetch_array($News, MYSQL_ASSOC)) {
> print "\t\t<p><b>".$line['MTime']."</b></p><p>".$line['Mess']."</p>\n";
> }
>
> You might want to use htmlentities(), at least on the Mess.
>
> Shawn
> --
> Shawn Wilson
>
shawn@glassgiant.com
>
http://www.glassgiant.com[/color]
It works great even with out using the htmlentities(), im going to see what
htmlentities do in the manual, just in case i need it or if its better to
use it.
Thanks
Marco