Populating an array from mysql db
| From: | mike karthauser | Date: | Thu, 28 Aug 2003 12:01:00 +0000 |
| Subject: | Populating an array from mysql db | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-30176@lists.php.net to get a copy of this message | ||
I have a course booking system that allows the client to add courses and
then specify how long they run for. The admin system I have built allows the
client to add up to 30 dates for each instance of the course and these are
adding to a database row in the form date1, date2, date3, daten etc.
What I am trying to achieve now is to extract this data into an array so I
can count how many dates have been added and to display the dates.
If the course runs for eg. 2 days - values of date1 and date2 would be
populated as date1=2003-09-01, date2=2003-09-02 - all other dates would be
default to 0000-00-00 and I wish to ignore these.
I'm trying to work out how to set up a loop to extract positive dates from
my db so I end up with
$bookdate[0] = '2003-09-01';
$bookdate[1] = '2003-09-02'; etc
Can anyone provide me with some help in this extraction?
Thanks in advance.
--
Mike Karthauser
Managing Director - Brightstorm Ltd
Email >> mikek@brightstorm.co.uk
Web >> http://www.brightstorm.co.uk
Tel >> 0117 9426653 (office)
07939 252144 (mobile)
Snailmail >> Unit 8, 14 King Square,
Bristol BS2 8JJ