RE: Table help needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: tamouse mailing lists [mailto:tamouse.lists@xxxxxxxxx]
> Sent: Saturday, October 20, 2012 1:53 AM
> To: admin
> Cc: Chris Payne; php-general@xxxxxxxxxxxxx
> Subject: Re:  Table help needed
> 
> On Fri, Oct 19, 2012 at 6:09 PM, admin <admin@xxxxxxxxxxxxxxxxxxx>
> wrote:
> >> -----Original Message-----
> >> From: Chris Payne [mailto:oxygenet32@xxxxxxxxx]
> >> Sent: Friday, October 19, 2012 7:01 PM
> >> To: <php-general@xxxxxxxxxxxxx>
> >> Subject:  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




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux