Forum Moderators: mack

Message Too Old, No Replies

sql/Database help

sql/Database help

         

meanweaver

7:12 pm on Jul 2, 2004 (gmt 0)

10+ Year Member



I am at day 1 of trying to learn sql, I want to be able to build a mysql database and then get queries back from it, on my web host i have something called phpmyadmin which means i can type my sql request in there to talk to the mysql database, the first problem is as this data base is used for a forum already can i just add a table to it and put my info in here of would i be best getting a new database created, also can anyone point me to a idiot proof tutorial as i have found a lot but they seem beyond me, i am an absolute beginner to this and only know what i have learned from the 1st few chapters of my php & mysql for dummies book.
My eventuall aim is to create a database for a friend who runs a bike shop so people can go to the site and just use a dropdown box to search for bikes by models or engine size ect, I know this will be a while off yet before i know enough for this but any advice for a novice would be of great help.
Regards Ian

curlykarl

7:53 pm on Jul 2, 2004 (gmt 0)

10+ Year Member



>>the first problem is as this data base is used for a forum already can i just add a table to it and put my info in here

Sure, just add a new table

What version of Dreamweaver (I'm guessing by your name)do you use?

There are plenty of PHP/Dreamweaver tutorials available at the Macromedia site, or a good book to buy would be

Dreamweaver MX: PHP Web Development
ISBN: 1904151116

Karl :)

meanweaver

8:56 pm on Jul 2, 2004 (gmt 0)

10+ Year Member



I have been using Dreamweaver mx for a while, the only php i have ever used is just a single line for includes, i have not even considered using dreamweaver for dynamic web pages to that extent, perhapd i am overlooking the obvious, I will check out the macromedia site. Thanks for your info.

Regards Ian

lorax

2:45 am on Jul 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I dunno guys/gals. I'm always leary of DW and PHP. Macromedia has invested in Cold Fusion and methinks (rightly or wrongly) that the tool isn't that smart when it comes to working with PHP.

I prefer to hand code this sort of stuff and would recommend you get familiar with PHP code. It's not that hard to get some basic skill under your belt to accomplish what you're attempting to do. You'll find we've discussed many useful PHP books [google.com].

But - whatever floats your boat - use one database. Read, learn, experiment.

nobody

3:13 pm on Jul 3, 2004 (gmt 0)

10+ Year Member



DW MX has all of that stuff built in - although if your handy with PHP, its best to code it by hand, if your on the wrong end of the learning curve - then let DW do the heavy lifting for you.

ergophobe

3:52 pm on Jul 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




But - whatever floats your boat - use one database

I assume you mean one database per site (or per independent unit)?
- do not run one forum off two databases.
- do not run two db-driven sites off a single database.

My main advice would be this. If you are experimenting, your absolute first experiment should (must!) be to install PHP and MYSQL on your workstation and build and play with your sites there. When you have them the way you want them, then upload.

bsterz

4:09 pm on Jul 3, 2004 (gmt 0)

10+ Year Member



I would agree that DW with PHP can be a bit messy. You can however use it with great success if you code within their "mindset". DW looks code and layout intermingled from a ColdFusion perspective and tends to not be very php-friendly for layout. Enter Smarty (cue the music).

How I manage to do this and keep my sanity is with Smarty. For those of you who don't know, Smarty is a templating engine for PHP. You do all of your php code in one file and all of your html in another. In code view, DW does an excellent job on the php files, in design view, DW does a great job on the Smarty template. DW still kinda drops the ball on most css stuff, but that's another thread.

Of course there will always be issues with any solution, but I have had great success with this method.

[smarty.php.net...]

Bill

curlykarl

6:01 pm on Jul 3, 2004 (gmt 0)

10+ Year Member



- do not run two db-driven sites off a single database.

Can you explain why?

I run three sites from one database with no problems (well not yet anyway)

My main advice would be this. If you are experimenting, your absolute first experiment should (must!) be to install PHP and MYSQL on your workstation and build and play with your sites there. When you have them the way you want them, then upload.

I would just go for it, trial and error and all that :)

Karl

ergophobe

6:49 pm on Jul 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Can you explain why?

I just think it's easier to manage. If you have multiple sites on one DB, you need to use table prefixes so you have

site1_users
site2_users

And have to keep them straight. It's more a convenience thing for me than some anything.

curlykarl

6:55 pm on Jul 3, 2004 (gmt 0)

10+ Year Member



ergophobe,

Understood, I thought I was missing something :)

For me all the database info is shared across all sites, so its not to much of a problem to manage it.

Karl :)

meanweaver

1:21 pm on Jul 5, 2004 (gmt 0)

10+ Year Member



Thanks for all replys, well i have worked out how to get info into the datatbase now, What i am now trying to work out is this, if i have a form field page and point it at the dynamic page, can that page return results from the database with just sql on it, as you can see i am very new to this and still getting my head around the very basics.

Thanks again Ian

curlykarl

1:37 pm on Jul 5, 2004 (gmt 0)

10+ Year Member



Check your sticky mail :)