Current location: Hot Scripts Forums » Programming Languages » PHP » PHP > MSQL - Loop date system


PHP > MSQL - Loop date system

Reply
  #1 (permalink)  
Old 06-12-04, 05:11 PM
dihan dihan is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 267
Thanks: 0
Thanked 0 Times in 0 Posts
PHP > MSQL - Loop date system

Hi peeps,

I'm using the follwing system in order to predict 4 weeks of a specfic dates on a comboBox ( can been seen on the "guestlist > guestlist" page on selectguestlist.com.)

$info['iddays']; - Is a number representing a day of the week. in this order:

0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
etc...

PHP Code:

// Select Date Script

$day_of_event $info['iddays']; // this will produce the number (0,1,2...)
$num_weeks 4// how many weeks ahead to show 

$diff $day_of_event date("w"); 
$timestamp strtotime("+" $diff " days"); 


for(
$i=1;$i<$num_weeks;$i++) 

   
$timestamp strtotime('+1 week'$timestamp); 
   echo 
'<option value="' $timestamp '">' date('l d F Y'$timestamp) . '</option>'


I want to alter this script so now instead of the predicting system it will simply give the corrosponding day by the day system shown obove (0 = Sunday...) to an xml output.


PHP Code:

while ($row=mysql_fetch_assoc($result))

{
echo 
'<info date="' date('l'$timestamp)'" 
club ="'
$row['club'] .'" 
address="'
$row['address'] .'"
info="'
$row['info'] .'" 
photourl="promopic/'
$row['photourl'] .'"/>';


So now depending of what $info['iddays'] will send the xml script will say the corresponding day.

Code:
<info date="Monday"
club ="A Club Name" 
address="(An address of a club)"
info="Two ......"
photourl="promopic/elysium.jpg"/>

<info date="Wednesday"
club ="Club Name" 
address="4 Club Address"
info="Models ......."
photourl="promopic/china.jpg"/>

Last edited by dihan; 06-12-04 at 05:17 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Art Nexus seeking PHP programmers TheArtNexus Job Offers & Assistance 5 02-26-08 03:08 AM
Form -> text file -> php variables Bonzo PHP 1 06-16-04 07:37 AM
php music review system Abraxas Job Offers & Assistance 3 06-14-04 05:18 AM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 06:02 AM
Class reservation system - php wardazo Script Requests 5 07-20-03 05:03 PM


All times are GMT -5. The time now is 05:02 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.