Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 06:51
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  PHP, Perl, ASP, JSP, CFM (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis, nothingGrinder)
| | |-+  Some help with PHP and MySQL please
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Some help with PHP and MySQL please  (Read 1842 times)
dsn7287
Server what's that
*
Posts: 6


View Profile Email
« on: 04/25/09, 04:42 »

Ok this is a pretty big problem for me (but it could be simple for someone with a lot of experience with php maybe?), just explaining it is gonna be a little tricky, so please bear with me as I try... Smiley

The website if for a rugby club. They have 7 teams  (or team_types - see below).
Ok this is what i have:
A database (lets say its called mydatabase) with a table called fixtures. The fields of the table are (among others):
team_type (1st team, 2nd team, 3rd team, 4th team, under 18, under 15, under 13, under 11)               
match_type (league, cup, friendly)
date_and_time (date and time of fixture. eg: 2009-05-23 12:30:00)
home_team (name of the home team [obviously can be the name of this club itself])
away_team (name of away team [obviously can be the name of this club itself])

Ok now to what I want to be able to do. On th home page, I have small sections like this (one for each team):
Next 1st XI Game
Code:
Date: <Display the date of the match here>
Oppositon: <Display the name of the opposing team>
Type: <Display the type of match>
Home/Away: <Display if the match is home or away> 

Basically what I want do do is this.
1. I need to be able to connect to the databse.
2. Retrieve the details of the match that is closest to current date and time but in the future. I know this probably sounds wrong but let me try to explain.

Right say today's date and time is 2009-04-25 15:00:00.
Say the fixtures table has 3 games:
a. 2009-04-24 12:00:00 (yesterday)
b. 2009-04-25 10:00:00 (today but earlier in the day)
c. 2009-04-28 12:00:00 (3 days from today).
In this case I would need to ensure that the match chosen is the one 3 days from the current date and time and not:
a. As this match was yesterday.
b. As the start time for this game has already passed.

3. Display the details of each teams matches in each team's relevant section as described above.

Any help would be very very much appreciated.

Cheers....   
« Last Edit: 04/25/09, 04:47 by dsn7287 » Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #1 on: 04/25/09, 12:14 »

for transport, read the loading and saving tutorials.
the rest is mainly a question of database organisation and queries.
this mainly depends on how you organized your database tables, fields and keys.
Logged

happy flashing
Cool
Ronald
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything