Re: Array help

From: Date: Fri, 23 Jul 2004 21:13:41 +0000
Subject: Re: Array help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-191695@lists.php.net to get a copy of this message
You can either hard code the associations, with something like a swtich statement, or i suppose loop thru one array, adding a key value pair of the numbers => background images. Or, you could create a table called Backgrounds, give them an id which you store in the existing field of your db, and use a table join to query the background name out . Does this help any? Jason On Fri, 23 Jul 2004 16:02:06 -0500, Robb Kerr <rkerr.news@digitaliguana.com> wrote: > I've got a field in my database that contains a single numerical character > ("1" or "2" or "3", etc.). I need to load a different background > image in > one cell of a table depending upon what the number the field contains. > What's the easy syntax for associating entries in the field ("1" or > "2" or > "3", etc.) with image filenames ("bkgrnd-default.gif" or > "bkgrnd-positive.gif" or "bkgrnd-negative.gif", etc.) > > Thanx, > Robb > > -- > Robb Kerr > Digital IGUANA > Helping Digital Artists Achieve their Dreams > ---------------------------------------------------- > http://www.digitaliguana.com > http://www.cancerreallysucks.org > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#191695) next »