Home: PHP Diary | Script School | PHP Scripts | TD Scripts.com
TD Forum - An unthreaded messageboard script to exchange ideas with your site visitors


[back]
go back01/02/03 "Part 1: How to create a convention planner script php mySQL" go forward[next]

Vegas Internext Convention: Jan 6, 2003 - Jan 8, 2003

I'm attending the Internext convention next week as I do a fair amount of programming work for clients in the adult business. If you are attending this convention, then let's try and hook up for a beverage :) For those who are also attending (at the time of this writing), here's the list of "official" parties happening at this show: http://www.internext-expo.com/html/parties/parties.shtml We arrive around 8pm Vegas time on Sunday Jan 5, 2003.

In realizing I needed some simple system for keeping track of who I'd be meeting and when. I already have a Palm pilot (Palm VIIx actually - I haven't upgraded to color) which I can take with me for notes from meetings. However, I wanted some simple system where I could make notes about what happened at the items I attended for web review (inside a private admin area for myself mainly).

PART 1: Creating a simple convention planner script using php / mySQL

Step 1. Create the display form that will show the convention planner data. In building any structure, one of the best first places to start is in how you imagine the data will look when it is output to the browser (or file, etc). I whipped up the following table display to show the data as I'd like to see it:

 

Date / Time start

Date / Time end

Event Type

Event Location

Details (contacts, etc)

Sun Jan 5 10:15pm

Sun Jan 6 12:15am

Meeting

Venetian lobby

mr jones cell: (555)555-1212
miss adams: cell: (555)555-1212

Notes: I learned that TDavid now has an RSS feed for syndicating the php-scripts.com diaries

Sun Jan 5 10:15pm

Sun Jan 6 12:15am

Meeting

Venetian lobby

mr jones cell: 555-1212

Notes: discussed future project

I decided to use mySQL to store the info. So next I created a simple table structure to go along with these fields of data:

event_start - DATETIME
event_end - DATETIME
event_type - VARCHAR(100)
event_location - VARCHAR(150)
event_details - BLOB
event_notes - BLOB

Step 2. Create the mySQL table syntax. The mySQL CREATE TABLE syntax for this table looks like this:

CREATE TABLE convention_planner
(
EVENT_ID INT NOT NULL AUTO_INCREMENT,
CONVENTION_ID INT,
  event_start DATETIME,
  event_end DATETIME,
  event_type VARCHAR(100),
  event_location VARCHAR(150),
  event_details BLOB,
  event_notes BLOB,
status CHAR(1),
PRIMARY KEY (EVENT_ID)
)

Here is an explanation of the 3 additional fields I added:

EVENT_ID - this is the unique ID number for each event
CONVENTION_ID - this is a number which will allow me to specificy different conventions, so I can use it for more than 1 convention.
status - this will determine the status of the event (it could be used to hide certain records, for example).

STEP 3. Create the mySQL table. For those with telnet/ssh access to their server you can use the table syntax above. For those who don't have this access then here is a php script which will create the table I've outlined.

<?
/* simple convention planner script by TDavid
 get mysql db name & info where 
 $user = mysql username and $pass = mysql password
 if you don't know what this is, then contact your host for help
*/
$mysql_link = mysql_connect("localhost", $user, $pass);
mysql_select_db($db, $mysql_link);

$query = "
CREATE TABLE convention_planner
(
EVENT_ID INT NOT NULL AUTO_INCREMENT,
CONVENTION_ID INT,
  event_start DATETIME,
  event_end DATETIME,
  event_type VARCHAR(100),
  event_location VARCHAR(150),
  event_details BLOB,
  event_notes BLOB,
status CHAR(1),
PRIMARY KEY (EVENT_ID)
)
";
mysql_query($query, $mysql_link);
print("successfully created convention planner -- be sure to delete this script from the server once done using");
?>

Now we have the table structure. In my next diary entry, Part 2, I'll show you how I'm building the admin form to input data into this table for this simple convention planner script.

Sites I surfed today and found cool / interesting / etc:

The following are sites that I surfed and found worthwhile in some way today. Drop these folks a line and tell them that TDavid sent you over.

Happy coding to you!
==============
New forum for discussion of diary entries

The homeroom at Script School is available to discuss this and other php-scripts.com diary entries. You must be an enrolled student at Script School to add comments to these diary entries.

Please vote on the usefulness of this diary entry so other people will know if it is worth their time to read :)

How useful was this diary entry? Avg Surfer Rating: 3.67 (49)

[back]go back 01/02/03 "Part 1: How to create a convention planner script php mySQL" go forward[next]

Home: PHP Diary | Script School | PHP Scripts | TD Scripts.com

Copyright 1999-2003 php-scripts.com Last Modified 01/11/03 01:10