> -----Original Message-----
> From: tamouse mailing lists [mailto:[email protected]]
> Sent: Saturday, October 20, 2012 1:53 AM
> To: admin
> Cc: Chris Payne; [email protected]
> Subject: Re: [PHP] Table help needed
>
> On Fri, Oct 19, 2012 at 6:09 PM, admin <[email protected]>
> wrote:
> >> -----Original Message-----
> >> From: Chris Payne [mailto:[email protected]]
> >> Sent: Friday, October 19, 2012 7:01 PM
> >> To: <[email protected]>
> >> Subject: [PHP] Table help needed
> >>
> >> Hi everyone,
> >>
> >> So i'm stuck, and I admit it. I have to (QUICKLY) display
> >> information from a database, easy. But the formatting they want is
> >> in a HTML table, 3 columns at a time and unlimited rows - how can I
> >> display 3 columns across at a time? Please help, it's a last minute
> thing !!!
> >>
> >> Chris
> >
> >
> > $query = "SELECT * TABLE";
> > $result = mysql_query($query);
> > If(mysql_num_rows($result) >= 1)
> > {
> > Echo "<table>";
> > While($row = mysql_fetch_assoc($result))
> > {
> > Echo
> >
> "<TR><TD>".$row[field1]."</TD><TD>".$row[field2]."</TD><TD>".$row[fiel
> > d3]."<
> > /TD></TR>
> > }
> > Echo "</table>";
> > }
>
> Surprised no one else has jumped on the "Don't use mysql anymore" thing
> here.
>
> Quick and dirty PDO implementation: https://gist.github.com/3922192
Chris,
Let me first apologize for a couple syntax errors I had in the real
quick explanation.
I answered your question in relationship to your knowledge of the subject based
on the question it's self.
I want to apologize for the comments that followed my reply, seems some people
can't make constructive comments
if their life depended on it. While the more complex version in PDO is the
preferred method to obtain objects
from mysql. This does require you to have the basic fundamentals of object
oriented programming skills,
which I am guessing at this point you do not have based on how the question was
phrased.
There are many people in the list who will gladly point you in the direction to
learning aids and tutorials to get you started.
Good Luck :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php