php-general Digest 21 May 2009 08:02:08 -0000 Issue 6132
Topics (messages 292839 through 292852):
Re: Really basic PHP questions -- newbie here!
292839 by: Lenin
product listing columns
292840 by: PJ
292841 by: PJ
292842 by: Ashley Sheridan
292843 by: Stephen
292844 by: PJ
292845 by: PJ
292846 by: Ashley Sheridan
292847 by: Michael A. Peters
292848 by: PJ
292849 by: PJ
292850 by: Michael A. Peters
292851 by: Ashley Sheridan
<table>-less layouts; Ideas welcome
292852 by: Jim Lucas
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
If not following some classes. I'd suggest Ellen to watch the videos for a
quick overview from NETTUTS and KillerPHP.
www.killerphp.com also google for some vidoes.
And you need to understand the facts of ServerSide, ClientSide, HTML,
WebServer, Permission of Files etc.
--- End Message ---
--- Begin Message ---
I am about to bust my donkey again trying to set up a dynamic product
listing for a web page using mysql, php & CSS (the donkey ride).
What better place to ask than here in guru heaven:
1. What's a good list/forum to ask for help on CSS - it just is too
illogical.
2. With mysql, is the best way to populate list columns with ul and li
or would just a simple column work fine? I have done this with a left
navigation column and could repeat such columns next to each other with
the final column with input fields for quantities ordered. Background
could just be an image to fill the container div.
Does that sound about right?
Thanks for any suggestions.
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
Forgot: you can get an idea of what I'm trying to do at
http://www.chiccantine.com/preview.html
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
On Wed, 2009-05-20 at 17:47 -0400, PJ wrote:
> Forgot: you can get an idea of what I'm trying to do at
> http://www.chiccantine.com/preview.html
> --
> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> -------------------------------------------------------------
> Phil Jourdan --- [email protected]
> http://www.ptahhotep.com
> http://www.chiccantine.com/andypantry.php
>
>
>
The link you gave doesn't exist online, I'm getting a 404. What do you
mean by a list in columns? Do you want a mysql select to be output as
several columns of data, or one column per select?
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
PJ wrote:
I am about to bust my donkey again trying to set up a dynamic product
listing for a web page using mysql, php & CSS (the donkey ride).
What better place to ask than here in guru heaven:
1. What's a good list/forum to ask for help on CSS - it just is too
illogical.
I suggest you take a look at sitepoint.com, for all aspects of web
building and design.
2. With mysql, is the best way to populate list columns with ul and li
or would just a simple column work fine? I have done this with a left
navigation column and could repeat such columns next to each other with
the final column with input fields for quantities ordered. Background
could just be an image to fill the container div.
Does that sound about right?
Thanks for any suggestions.
It seems to me that you are actually building a table and should use
html tables. With css for the
layout and formatting, of course. :)
Stephen
--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
> On Wed, 2009-05-20 at 17:47 -0400, PJ wrote:
>
>> Forgot: you can get an idea of what I'm trying to do at
>> http://www.chiccantine.com/preview.html
>> --
>> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
>> -------------------------------------------------------------
>> Phil Jourdan --- [email protected]
>> http://www.ptahhotep.com
>> http://www.chiccantine.com/andypantry.php
>>
>>
>>
>>
> The link you gave doesn't exist online, I'm getting a 404. What do you
> mean by a list in columns? Do you want a mysql select to be output as
> several columns of data, or one column per select?
>
:-[ sorry bout that... should have checked - was working with my mouth
& not my brain.
It works now. I forgot to upload.
hadn't thought about how many columns per select... ???
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
Stephen wrote:
> PJ wrote:
>> I am about to bust my donkey again trying to set up a dynamic product
>> listing for a web page using mysql, php & CSS (the donkey ride).
>> What better place to ask than here in guru heaven:
>> 1. What's a good list/forum to ask for help on CSS - it just is too
>> illogical.
>>
> I suggest you take a look at sitepoint.com, for all aspects of web
> building and design.
Oh, I stumble across it from time to time... but I've got a rather large
collection of bookmarks to looks for help. Thanks for that.
>> 2. With mysql, is the best way to populate list columns with ul and li
>> or would just a simple column work fine? I have done this with a left
>> navigation column and could repeat such columns next to each other with
>> the final column with input fields for quantities ordered. Background
>> could just be an image to fill the container div.
>> Does that sound about right?
>> Thanks for any suggestions.
>>
> It seems to me that you are actually building a table and should use
> html tables. With css for the
> layout and formatting, of course. :)
Well, I just read most of the debate on css & tables... and I think it
can be done. I am already stumbling on some design issues which are
absolutely ridiculous in css... for example, I haven't understood or
figured out why a <div id="whatever"> refuses to shrink the bottom
boundary no matter what directions it is given without any apparent
reason. I have checkd inheritance, !important, nesting, clear, inline,
etc. and nothing does it. But I have already filled columns from mysql
wich css and it looks and works just fine.
Besides, it's a challenge. ;-)
>
>
> Stephen
>
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
On Wed, 2009-05-20 at 19:20 -0400, PJ wrote:
> Ashley Sheridan wrote:
> > On Wed, 2009-05-20 at 17:47 -0400, PJ wrote:
> >
> >> Forgot: you can get an idea of what I'm trying to do at
> >> http://www.chiccantine.com/preview.html
> >> --
> >> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> >> -------------------------------------------------------------
> >> Phil Jourdan --- [email protected]
> >> http://www.ptahhotep.com
> >> http://www.chiccantine.com/andypantry.php
> >>
> >>
> >>
> >>
> > The link you gave doesn't exist online, I'm getting a 404. What do you
> > mean by a list in columns? Do you want a mysql select to be output as
> > several columns of data, or one column per select?
> >
> :-[ sorry bout that... should have checked - was working with my mouth
> & not my brain.
>
> It works now. I forgot to upload.
> hadn't thought about how many columns per select... ???
>
> --
> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> -------------------------------------------------------------
> Phil Jourdan --- [email protected]
> http://www.ptahhotep.com
> http://www.chiccantine.com/andypantry.php
>
>
So you want the sql select to be dumped into a table as it exists in the
database?
There is a simple way to do this, if you know which fields are in your
table, and that is just to use a while loop to iterate your records, and
then explicitly output each field as you want it. This is the preferred
way, and how I'd do it if I were you.
print '<table>';
// put column headers here
$query = "query here";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
print '<tr>';
print "<td>{$row['field1'])</td>";
print "<td>{$row['field2'])</td>";
print "<td>{$row['field3'])</td>";
// etc
print '</tr>';
}
print '</table>';
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
PJ wrote:
I am about to bust my donkey again trying to set up a dynamic product
listing for a web page using mysql, php & CSS (the donkey ride).
What better place to ask than here in guru heaven:
1. What's a good list/forum to ask for help on CSS - it just is too
illogical.
I don't think I've ever asked anything here, but I've found answers via
google at http://forums.devshed.com/css-help-116/ quite often.
I don't do a lot with CSS though.
2. With mysql, is the best way to populate list columns with ul and li
or would just a simple column work fine? I have done this with a left
navigation column and could repeat such columns next to each other with
the final column with input fields for quantities ordered. Background
could just be an image to fill the container div.
Does that sound about right?
Thanks for any suggestions.
For navigation columns I always use a list.
You can do some need stuff with list via CSS to make either a top - down
navigation bar or a horizontal navigation bar - and they still work well
in non-graphical browsers, where they simply display as a list.
--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
> On Wed, 2009-05-20 at 19:20 -0400, PJ wrote:
>
>> Ashley Sheridan wrote:
>>
>>> On Wed, 2009-05-20 at 17:47 -0400, PJ wrote:
>>>
>>>
>>>> Forgot: you can get an idea of what I'm trying to do at
>>>> http://www.chiccantine.com/preview.html
>>>> --
>>>> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
>>>> -------------------------------------------------------------
>>>> Phil Jourdan --- [email protected]
>>>> http://www.ptahhotep.com
>>>> http://www.chiccantine.com/andypantry.php
>>>>
>>>>
>>>>
>>>>
>>>>
>>> The link you gave doesn't exist online, I'm getting a 404. What do you
>>> mean by a list in columns? Do you want a mysql select to be output as
>>> several columns of data, or one column per select?
>>>
>>>
>> :-[ sorry bout that... should have checked - was working with my mouth
>> & not my brain.
>>
>> It works now. I forgot to upload.
>> hadn't thought about how many columns per select... ???
>>
>> --
>> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
>> -------------------------------------------------------------
>> Phil Jourdan --- [email protected]
>> http://www.ptahhotep.com
>> http://www.chiccantine.com/andypantry.php
>>
>>
>>
> So you want the sql select to be dumped into a table as it exists in the
> database?
>
> There is a simple way to do this, if you know which fields are in your
> table, and that is just to use a while loop to iterate your records, and
> then explicitly output each field as you want it. This is the preferred
> way, and how I'd do it if I were you.
>
> print '<table>';
> // put column headers here
> $query = "query here";
> $result = mysql_query($query);
> while($row = mysql_fetch_array($result))
> {
> print '<tr>';
> print "<td>{$row['field1'])</td>";
> print "<td>{$row['field2'])</td>";
> print "<td>{$row['field3'])</td>";
> // etc
> print '</tr>';
> }
> print '</table>';
>
>
Thanks, Ashley,
So, you're advocating using tables...
I thought it might be interesting to do the columns with <div> inline
and then populate them with the query results. It worked marvellously
for the navigation layout and I was able to add background and color to
the product page, regardless which product page we're showing. Quite
neat, really, and very simple. Anyway, I'm going to try.
I must be nuts or something like glutton for punishment, but when you
get it working, it's quite a satisfaction. :-) Thanks again.
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
Michael A. Peters wrote:
> PJ wrote:
>> I am about to bust my donkey again trying to set up a dynamic product
>> listing for a web page using mysql, php & CSS (the donkey ride).
>> What better place to ask than here in guru heaven:
>> 1. What's a good list/forum to ask for help on CSS - it just is too
>> illogical.
>
> I don't think I've ever asked anything here, but I've found answers
> via google at http://forums.devshed.com/css-help-116/ quite often.
>
> I don't do a lot with CSS though.
>
>> 2. With mysql, is the best way to populate list columns with ul and li
>> or would just a simple column work fine? I have done this with a left
>> navigation column and could repeat such columns next to each other with
>> the final column with input fields for quantities ordered. Background
>> could just be an image to fill the container div.
>> Does that sound about right?
>> Thanks for any suggestions.
>>
>
> For navigation columns I always use a list.
> You can do some need stuff with list via CSS to make either a top -
> down navigation bar or a horizontal navigation bar - and they still
> work well in non-graphical browsers, where they simply display as a list.
>
Hmmm.... I first thought of using the ul & li stuff... but I'm not sure
it will populate from a query too easily... ?? especially as I am rather
determined to try for a css approach.
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
PJ wrote:
Michael A. Peters wrote:
PJ wrote:
I am about to bust my donkey again trying to set up a dynamic product
listing for a web page using mysql, php & CSS (the donkey ride).
What better place to ask than here in guru heaven:
1. What's a good list/forum to ask for help on CSS - it just is too
illogical.
I don't think I've ever asked anything here, but I've found answers
via google at http://forums.devshed.com/css-help-116/ quite often.
I don't do a lot with CSS though.
2. With mysql, is the best way to populate list columns with ul and li
or would just a simple column work fine? I have done this with a left
navigation column and could repeat such columns next to each other with
the final column with input fields for quantities ordered. Background
could just be an image to fill the container div.
Does that sound about right?
Thanks for any suggestions.
For navigation columns I always use a list.
You can do some need stuff with list via CSS to make either a top -
down navigation bar or a horizontal navigation bar - and they still
work well in non-graphical browsers, where they simply display as a list.
Hmmm.... I first thought of using the ul & li stuff... but I'm not sure
it will populate from a query too easily... ?? especially as I am rather
determined to try for a css approach.
<ul>
<?php
sql code here, print <li></li>
?>
</ul>
You can style a list with css. And the list still displays nicely in non
graphical browsers that ignore style.
--- End Message ---
--- Begin Message ---
On Wed, 2009-05-20 at 20:23 -0400, PJ wrote:
> Ashley Sheridan wrote:
> > On Wed, 2009-05-20 at 19:20 -0400, PJ wrote:
> >
> >> Ashley Sheridan wrote:
> >>
> >>> On Wed, 2009-05-20 at 17:47 -0400, PJ wrote:
> >>>
> >>>
> >>>> Forgot: you can get an idea of what I'm trying to do at
> >>>> http://www.chiccantine.com/preview.html
> >>>> --
> >>>> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> >>>> -------------------------------------------------------------
> >>>> Phil Jourdan --- [email protected]
> >>>> http://www.ptahhotep.com
> >>>> http://www.chiccantine.com/andypantry.php
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>> The link you gave doesn't exist online, I'm getting a 404. What do you
> >>> mean by a list in columns? Do you want a mysql select to be output as
> >>> several columns of data, or one column per select?
> >>>
> >>>
> >> :-[ sorry bout that... should have checked - was working with my mouth
> >> & not my brain.
> >>
> >> It works now. I forgot to upload.
> >> hadn't thought about how many columns per select... ???
> >>
> >> --
> >> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> >> -------------------------------------------------------------
> >> Phil Jourdan --- [email protected]
> >> http://www.ptahhotep.com
> >> http://www.chiccantine.com/andypantry.php
> >>
> >>
> >>
> > So you want the sql select to be dumped into a table as it exists in the
> > database?
> >
> > There is a simple way to do this, if you know which fields are in your
> > table, and that is just to use a while loop to iterate your records, and
> > then explicitly output each field as you want it. This is the preferred
> > way, and how I'd do it if I were you.
> >
> > print '<table>';
> > // put column headers here
> > $query = "query here";
> > $result = mysql_query($query);
> > while($row = mysql_fetch_array($result))
> > {
> > print '<tr>';
> > print "<td>{$row['field1'])</td>";
> > print "<td>{$row['field2'])</td>";
> > print "<td>{$row['field3'])</td>";
> > // etc
> > print '</tr>';
> > }
> > print '</table>';
> >
> >
> Thanks, Ashley,
> So, you're advocating using tables...
> I thought it might be interesting to do the columns with <div> inline
> and then populate them with the query results. It worked marvellously
> for the navigation layout and I was able to add background and color to
> the product page, regardless which product page we're showing. Quite
> neat, really, and very simple. Anyway, I'm going to try.
> I must be nuts or something like glutton for punishment, but when you
> get it working, it's quite a satisfaction. :-) Thanks again.
>
> --
> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> -------------------------------------------------------------
> Phil Jourdan --- [email protected]
> http://www.ptahhotep.com
> http://www.chiccantine.com/andypantry.php
>
>
I'm advocating tables on this one, as it is pretty much tabular data.
Use <th> tags for your column headers and product names, and <td>s for
the rest. It will be easier to display, but with actually give your
content meaning, especially if you add a table legend, etc.
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Since this has been a topic of dicussion, I figured I would add my thoughts.
I have been toying with the idea of doing a <table>-less layouts involving tabular data, calendars,
etc...
Recent threads have finally made me do it. Let me know what you think.
http://www.cmsws.com/examples/templates/div_tables.php
http://www.cmsws.com/examples/templates/div_tables.phps (source for above)
http://www.cmsws.com/examples/templates/div_cal.php
When you turn off the styles, the calendar becomes pretty rough on the eyes, but still
"accessible".
Same thing with the tabular data structure.
But, not knowing how the various types of accessibility applications work, I am guessing that the
layout to an application trying to read it should work fairly well. Let me know if I am way off the
mark with my thoughts.
If you want to respond off list, that if fine by me.
TIA
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--- End Message ---