Sql/php

m0nkeybl1tz

CAGiversary!
Feedback
4 (100%)
So, I'm trying to create a searchable database for a website I'm working on, but I've only ever really used HTML. Looking around online, it seems like using SQL and PHP would be the best thing for that, but I have no idea how to get an SQL database online, and how to implement PHP in a webpage.

I think I could learn the languages pretty quickly, since I already know C++, but I need to know how to set up a webpage using these things, i.e. do I need any special programs, will places like Geocities host it? Thanks for the help.
 
geocities won't host a sql database and probably won't even serve php pages. (Not sure on that but most free hosts won't host php and I don't think there are any that will give you a DB.)

To get a DB online you need a host that gives you the DB (mySQL in my experience) and then you just run the scripts to create the desired tables.
 
Wubb is right, you need a host that will allow you to run the php, and host the database.

If you want to develop locally for now, check out apache2triad or Uniform Server, both run and set up easily under windows.

Also look at www.php-editors.com for some free editors.

Hope this helps.
 
[quote name='m0nkeybl1tz']So, I mean, can I just create a document that ends in .sql? Do I just write the PHP code in an HTML document? Thanks.[/QUOTE]

Try to find some beginner's guides to PHP and SQL would be my main advice.

PHP files are very similar to html pages, but they end with the .php extension and include php code within them.

One of the things I've done with php is use the include statement to include the same content on every page (such as a navigation sidebar or footer) without having to use frames. Then if you need to add a section to your sidebar you just add it to your included file and it flows out to all of your pages with that one edit. Not sure if that sort of thing interests you, but as you know it can also work with DBs.

A sql file would contain a sql script, but without a database on your host it's not going to work or do anything. You are going to run some scripts initially to create the DB and add your tables. In my experience you'll have a control panel where you paste the script you want to run and then execute it. Once the tables are setup your PHP code will be used to access, insert, and manipulate the data in the tables.

cside's suggestion to install a server on your local box to use for your initial investigation and learning is a good one. But I think you are going to have to pay for a host to have those tools on a real site.
 
[quote name='m0nkeybl1tz']So, I mean, can I just create a document that ends in .sql? Do I just write the PHP code in an HTML document? Thanks.[/QUOTE]

Yeah, just make a file and put a .php extension on there yourself.

When you're coding in PHP, you just start and end with .

So like



Or



You can even start/stop PHP within a line. For example:

< table width="" height="100">


Easiest way to go about integrating SQL would be to use MySQL. MySQL's official site has MySQL Administrator and MySQL Query Browser, which are used to create / edit databases in conjunction with services provided by your host.

It's really not that complicated of a language, but it's incredibly powerful. I find coding in PHP (with SQL databases) to be very enjoyable.


Also: if you just want to fiddle around with it, try the site Clawz.com. Clawz does have ads and you do need to get approved for hosting (it's not hard), but they do offer free PHP hosting with optional MySQL databases. I did a lot of my testing there before I opened my site.

Then again, you can find dirt cheap hosting now-a-days. Like $2 a month.
 
bread's done
Back
Top