GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 18-Oct-2004, 02:50
misunderstood misunderstood is offline
Member
 
Join Date: Jun 2003
Posts: 121
misunderstood is on a distinguished road

array


I have found a small calander script that suits my site but I am trying to modify it slightly and have hit a problem.

The calander displays great but there is an array at the bottom that allows you to add certain dates to generate a link.
PHP Code:

$days = array(
        2=>array('/2004/Jan/02','linked-day'),
        3=>array('/2004/Jan/03','linked-day'),
        8=>array('/2004/Jan/08','linked-day'),
        22=>array('/2004/Jan/22','linked-day'),
           ); 


What I am trying to do is match the days with data that in my database. If there is a match then print the lines.
ie If my database has a match for the dates 2 and 3 then the code would be
PHP Code:

$days = array(
        2=>array('/2004/Jan/02','linked-day'),
        3=>array('/2004/Jan/03','linked-day'),
           ); 


I can get my print to list the lines correctly but once I try to place it in the
PHP Code:

array( $MY_LINES_HERE ); 


it wont work.
I have tried looking at all the manuals etc but just cant work it out.
  #2  
Old 21-Oct-2004, 15:06
misunderstood misunderstood is offline
Member
 
Join Date: Jun 2003
Posts: 121
misunderstood is on a distinguished road
Solved and working.
Finally got a little calander that pulls 'post dates' from 3 different tables and highlights the days where something has news, report or event.
Feeling rather proud of myself
  #3  
Old 22-Oct-2004, 06:46
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Now I know why you call yourself "misunderstood" - I still don't know what you were trying to ask when you started this thread.
  #4  
Old 22-Oct-2004, 09:10
JasonMichael's Avatar
JasonMichael JasonMichael is offline
Awaiting Email Confirmation
 
Join Date: Jul 2004
Posts: 135
JasonMichael has a spectacular aura about
I *think* he's trying to get PHP code for setting variables to be put into a variable called $MY_LINES_HERE, and run it. If so, this won't work.
  #5  
Old 22-Oct-2004, 12:05
misunderstood misunderstood is offline
Member
 
Join Date: Jun 2003
Posts: 121
misunderstood is on a distinguished road
Quote:
Now I know why you call yourself "misunderstood" - I still don't know what you were trying to ask when you started this thread.

What, you dont use ESP and mind reading! ;-)

Quote:
I *think* he's trying to get PHP code for setting variables to be put into a variable called $MY_LINES_HERE, and run it. If so, this won't work.


Quick explaination (clearer explaination)
I had a line in a script that contained something similar to:
PHP Code:

$days = array( 
        2=>array('/2004/Jan/02','linked-day'), 
        3=>array('/2004/Jan/03','linked-day'), 
           ); 



The arrays contained in the array $days worked when the line was physically typed. What I wanted to do was build the arrays contained in the $days array from a database containing none matching tables. The number 2 and 3 in the example had to be replaced with the day and the month with the month and the year with the year extracted from the tables dates column. the last section is common text. Clear as mud eh!

Anyway with a little help from someone who was as confused as you are all now I got it working so the arrays were formed from the data extracted from the tables dates columns (all dates columns named differently) and placed into the $days array. And all without blowing up my computer!

Sorry I have confused you all even more.
  #6  
Old 22-Oct-2004, 20:45
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Ah.. I see what you were asking now. But, even now, I can't suggest anything because anyone attempting to help you with this, will need to see the structure of the MySQL table which should have been already described in your message when you started this thread.
 
 

Recent GIDBlogProblems with the Navy (Enlisted) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
more array help (simulation project..) dilmv C++ Forum 6 17-Oct-2004 07:51
Speed up C++ code about 3d array! Truong Son C++ Forum 0 16-Mar-2004 21:52
c: array comparison jack C Programming Language 7 26-Jan-2004 11:21
Extra null element in an array samtediou MySQL / PHP Forum 2 11-Dec-2003 11:52

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:32.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.