Easiest way

aloser

Senior member
Nov 20, 2004
511
1
81
Hi all,
I'm working on my website again\still and trying to set up the "travel agency" part.

I know enough to say that I need a database, but how would it be best to go about getting one and subsequently linking it to the form? (I have MySQL installed already)
Most of the tutorials I have read haven't been a very big help or guide.


To summarize, I have several old rail timetables that I will be scanning in (airline also eventually) and using for the basis. What I'm wanting is something like Travelocity or Expedia or Orbitz or any other major travel site - to book your trip, simply select your travel details and then the list pops up with the different possibilities. I have most of the site built; it just needs to be automated now.

To get a better idea, please visit http://www.nscalecanada.com/ and log in under "anandtech" and "password" for the password (or you could sign up your own account also, hint hint hint). Once you're logged in, select "book a trip" (your choice of rail companies) and fill out the form. It will then email to me, and I have to manually create the trip. (That's what I want changed) I want the form to generate the possible itineraries. Any help is greatly appreciated! Thanks!
 

aloser

Senior member
Nov 20, 2004
511
1
81
Bump and s'more info...

This is basically how my timetables look that I will be using in said database. What I'm wanting is to search for any city and have it bring up all the possible trains or connections. Using this Amtrak timetable for an example, to get from from Vancouver to Duluth requires taking the bus from Vancouver to Seattle, the Empire Builder to Minneapolis, and another bus to Duluth. My question, ultimately, is how to code that into the database (and without using the return trip times)?
 

fs5

Lifer
Jun 10, 2000
11,774
1
0
if you want a graphical interface to your MySQL database, install PHPMyAdmin.
From the looks of it you're gonna have to do your calculating in whatever language you're coding in. Use MySQL to do basic date subtraction / simple arthimetic between the large tables.
 

ugh

Platinum Member
Feb 6, 2000
2,563
0
0
MySql GUI development has been suspended. The replacement is now MySql Query Browser (http://dev.mysql.com/downloads/query-browser/1.1.html).

I'd go for phpMyAdmin over MySql Query Browser. Reason being is that the latter is quite buggy. It crashes on me quite often while phpMyAdmin remains pretty useful even though it's based on a web interface.
 

homercles337

Diamond Member
Dec 29, 2004
6,340
3
71
#1) Why are so many posting about a mySQL GUI? Sounds like this is more of a DB design issue to me. Kinda like, "how do i determine what tables to set up and how to access them?" No? Seems like you have two big tables so far, bus & train. YOu could easily join these tables with queries based on time of arrival/time of depature. To do this in a web format, use PHP, but this will be BIG project.

#2) Am i totally wrong, and youre asking about how to link to the Amtrak DB?
 

aloser

Senior member
Nov 20, 2004
511
1
81
I was partucularly leaning towards #1 (what fields to use and how to set them up with PHP). As I stated earlier, most of the work design-wise (PHP I mean) for my form is done; I have to relink to my new database (once someone is nice enough to say HOW to do that properly...) ;) I'm not so concerned about the GUI part as I am getting it set up properly. Granted the GUI looks pretty (that's the whole point after all) but all the prettiness in the world won't make a messed up db work.

Next step (since it's clearly going to take a lot of work, which I was somewhat aware of already) - any of you able to hack into Travelocity (or whatever) and get me a copy of their database so I have less to do? :) (or better yet; anyone WORK for a web agency like that and can get me a copy legally, w/o having to hack into the system?)
 

homercles337

Diamond Member
Dec 29, 2004
6,340
3
71
Sounds like you really need to do some reading on RDB design. I could easily design your DB for you, but if you dont understand the design its useless to you (yes, i have encountered this before with people that have bastardized my designs because they didnt know sh!t about RDB design). Worse yet, if you dont understand the design how do plan to extend it? Because you will have to extend it...
 

WildHorse

Diamond Member
Jun 29, 2003
5,006
0
0
Originally posted by: aloser
I was partucularly leaning towards #1 (what fields to use and how to set them up . . . I have to relink to my new database (once someone is nice enough to say HOW to do that properly...

ALOSER:
Your question isn't the sort of thing that can be answered in a quick little exchange of posts on a web board. Getting the foundation you need requires time & effort studying.
Since you're going to do some serious work with databases, you need to take Step #1 first.

Step #1 is to invest time in learning how to set up a relational database; things like: How to normalize it, How to structure your data tables; How to structure relationships between tables, Indexing, to learn SQL, & other good things.

That's a non-trivial study, and to get the kind of results you want it realistically can easily require a course and study of some books, & good coaching. It requires some depth & some time. But it's easy & you'll master it fast.

Programming the database using PHP is way down the line from that, like maybe Step #20.

If you just try to muddle through to get something up & running, you WILL end up unhappy with a big mess, & have to start over.

Suggest you reschedule your project and postpone going live for a while, so you can dive into mastering Step #1. Then you'll have good prospects to succeed with great results!

Go get 'em!
 

aloser

Senior member
Nov 20, 2004
511
1
81
Hmm... So you're saying, then, that once I complete my studying I will have been able to answer this on my own? Boy, that's what I get for asking FIRST as opposed to working harder on my studying... (I'm just getting started in the RDB field, which was what made me realize that it's what I was missing in the first place)

Next step I guess is whether mySQL or PostGRE is better? Or it that just a matter of personal preference?
 

WildHorse

Diamond Member
Jun 29, 2003
5,006
0
0
"a matter of personal preference"= yes, guys tend to be opinionated about that.

but MySQL is probably the better way to go because it has far more marketplace saturation.

So once your new website is a shooting star of success some travel company will want to cash you out & then the stuff you did in MySQL's dialect of SQL has stronger chance of being directly interoperable with whatever else prevails in the market then, without conversion. But like you said, it's "a matter of personal preference."

You say,
"Hmm... So you're saying, then, that once I complete my studying I will have been able to answer this on my own? Boy, that's what I get for asking FIRST as opposed to working harder on my studying..."

Well, lots of guys would gladly help you as best they can on boards like this, but like I said, your question isn't the sort of thing that can be answered in a quick little exchange of posts on a web board. I appreciate that it's not what you hoped to hear, but it's true.
 

ugh

Platinum Member
Feb 6, 2000
2,563
0
0
If #1 is your choice, you might want to pick up a SQL book or search for some online tutorials to get the hang of things first.
 

aloser

Senior member
Nov 20, 2004
511
1
81
Well, just an update - I looked at some of the online tutorials and got a somewhat better idea of what I read in the library, so this ought to be easier than I had suspected in the first place. Just goes to prove that reading up on something will always make the task easier to do!
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Its things like this that make me sad. It sounds like you need to hire a DBA. Depending on the size of the project, MySQL does not scale well, you might be wise to look at PostgreSQL or Oracle. Especially if you want to move a lot of the programming logic to the database with stored procedures and functions. I don't believe MySQL supports everything you can do in PostgrSQL and Oracle with PL/SQL. This is not something that can be taken lightly. I suggest hiring someone with proper database exp. You need someone who understands how to set your constraints properly and size the database properly. If your query's or index's are poor your site will dog (if this is anything as big as the reference sites you mentioned).

As for the program side of things. I suggest using php with the PearDB module.
For a nice query browser/admin app. I suggest http://www.aquafold.com/index.html . It works great for me. If you need a little more in depth try out toad or SQL developer (if you are using oracle).

Otherwise, from the description you have given, it sounds like a task that is too big to handle. It sounds like you need interfaces to convert and import tables from other companys into your database regularly, and that you also need a strong, scalable, database design. These are things that take a few years to learn how to do well, not a few days or posts on a forum. If you jump into this, I suspect a high chance of failure. I have been a part of (and am currently doing one for a small college) a few large scale database conversions and software application design. This is not something anyone can do fresh out of school or with a php and mysql book for dummys. This is something that has to be built too with smaller projects and experience in writing functional reusable code and strong database design (usually not the same person, but it helps to have both).
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
You at a minimum need to get a book (reference) on using PHP with MySQL.
 

aloser

Senior member
Nov 20, 2004
511
1
81
<and import tables from other companys into your database regularly>

No - this is just a one-time setup. All it's (intended) to do is automate my booking process, which really isn't that big of a deal; I just thought that the automation would make it seem more realistic.

I have seriously been considering hiring someone to do this. Maybe one of the travel sites could direct me to their designer...
 

WildHorse

Diamond Member
Jun 29, 2003
5,006
0
0
Originally posted by: aloser

No - this is just a one-time setup. All it's (intended) to do is automate my booking process, which really isn't that big of a deal; I just thought that the automation would make it seem more realistic.

I have seriously been considering hiring someone to do this. Maybe one of the travel sites could direct me to their designer...

Are you in school?

If you are, see if there's a professor there teaching a database course, & go visit him.

That might help you find your way.

 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I think I read too much into your project. I thought you were going to do real time updates from airlines and rail companys. So now I'm a little confused. Do you already have the database and you just need a php script to hook into it? Or is your current method on paper?
 

aloser

Senior member
Nov 20, 2004
511
1
81
Well... The database is set up, hopefully it's right. All I'm really needing still is a script to link it all together now and I think (or hope) that's all it will take...
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I would head over to php.net and look up mysql_connect and mysql_query and mysql_fetch_array. Those should be all you really need then.