Is my array understanding correct? [message #178780] |
Thu, 02 August 2012 15:28 |
|
richard
Messages: 213 Registered: June 2013
Karma: 0
|
Senior Member |
|
|
<?php
$artistsA = array(
"A.B. Skhy" => array("chart"=>"Camel Back","Flip"=>"Just What I
Need","Label"=>"MGM K14086","Date"=>"12/8/69"),
"Aaron Neville" => array("chart"=>"She Took You For A Ride","Flip"=>"Space
Man","Label"=>"Parlo 103","Date"="3/25/67",
"chart"=>"Tell It Like It Is","Flip"=>"Why
Worry","Label"=>"Parlo 101","Date"=>"12/3/66")
);
?>
Eventually, the output will look just like this page does now.
http://mroldies.net/Artists-A1.html
Each time a new "artist" table is created, the code will produce the
required rows and columns.
Question is, is it proper to have the key names as I show?
Or do I need to uniquely identify each key value somehow?
Then, there is the problem of linking that I do not yet understand.
My thinking is instead of linking each title, just use a button in another
column.Then that would make things easier for coding.
|
|
|
Re: Is my array understanding correct? [message #178781 is a reply to message #178780] |
Thu, 02 August 2012 18:01 |
Doug Miller
Messages: 171 Registered: August 2011
Karma: 0
|
Senior Member |
|
|
richard <noreply(at)example(dot)com> wrote in news:13wa7y8varcbm$.1te7fi50zhu8l.dlg@
40tude.net:
>
> <?php
>
>
> $artistsA = array(
> "A.B. Skhy" => array("chart"=>"Camel Back","Flip"=>"Just What I
> Need","Label"=>"MGM K14086","Date"=>"12/8/69"),
> "Aaron Neville" => array("chart"=>"She Took You For A Ride","Flip"=>"Space
> Man","Label"=>"Parlo 103","Date"="3/25/67",
> "chart"=>"Tell It Like It Is","Flip"=>"Why
> Worry","Label"=>"Parlo 101","Date"=>"12/3/66")
> );
> ?>
>
> Eventually, the output will look just like this page does now.
> http://mroldies.net/Artists-A1.html
Why do you think you need to put it in an array at all?
|
|
|
Re: Is my array understanding correct? [message #178782 is a reply to message #178780] |
Thu, 02 August 2012 18:28 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
.oO(richard)
> <?php
>
>
> $artistsA = array(
> "A.B. Skhy" => array("chart"=>"Camel Back","Flip"=>"Just What I
> Need","Label"=>"MGM K14086","Date"=>"12/8/69"),
> "Aaron Neville" => array("chart"=>"She Took You For A Ride","Flip"=>"Space
> Man","Label"=>"Parlo 103","Date"="3/25/67",
> "chart"=>"Tell It Like It Is","Flip"=>"Why
> Worry","Label"=>"Parlo 101","Date"=>"12/3/66")
> );
> ?>
>
> Eventually, the output will look just like this page does now.
> http://mroldies.net/Artists-A1.html
>
> Each time a new "artist" table is created, the code will produce the
> required rows and columns.
> Question is, is it proper to have the key names as I show?
> Or do I need to uniquely identify each key value somehow?
Only problem will be artists of the same name, so a unique numeric key
might be better. But why don't you use a database?
If you want to stick with the arrays, you could use a single array for
all artists, sorted by name.
Micha
--
http://mfesser.de/
Fotos | Blog | Flohmarkt
|
|
|