Re: array issues

From: Date: Tue, 27 Feb 2007 22:45:46 +0000
Subject: Re: array issues
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-249530@lists.php.net to get a copy of this message
Just add another array for each with $artist as the key. while ($artist, $vote, $email) = mysql_fetch_row($results)){ $votes[$artist] = $vote; $emails[$artist] = $email; } Although, actually, there is probably some better ways to do what you are doing, but with only the query to look at, it's hard to tell... On Mon, February 26, 2007 6:13 am, Steven Macintyre wrote: > Hi all, > > I am working on a project for someone and with the brief I received > before - > I created a record per action with the following information; > > Artist[tab]artist[tab]artist[tab] etc as a entry for "artists" > > Then I have the same for titles etc ... > > What I have been doing is creating the array's and combining them ... > with > artist as a key and song as a value... > > Now ... they are requesting that I have the an additional 3 fields ... > how > would I now accomplish this? > > Bear in mind its php 4 and I am using a combine_array generic from the > www.php.net site in lieu of array_combine. > > I have paste a sample record below; > > INSERT INTO votes_records (id, > date, who, > title, > description, > image, email, > artists, titles, > votes, weeks, > twoweekpos, > oneweekpos, debut) VALUES > (22, '2007-02-26 12:29:15', 1, 'Test Again', '', '', > '', 'Artist > 1Artist > 2', 'Song 1Song 2', '1', '51', '20', > '10', > '2005/02/092005/02/09'); > > The net effect that I need to get - is take that information and > display it > per item so people can vote. > > S > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#249530) next »