PDA

View Full Version : Help...


Shaolins-Finest
04-14-2006, 09:21 AM
Hello All,

Basically I have a download page (empty). On the catagories I have the type of download (e.g. video downloads) and next to it I would like a number telling me the number of videos avalible to download.
Now, Im new to this so please be patient. I know Im going to need a SQL Database. But I need to know:

1) how to create one
2) and to link it to my webpage and extract the correct information.

If anyone can help me, this will be GREATLY appreciated.

Many Thanks
Shaolin.

scoutt
04-14-2006, 04:05 PM
well your host generally creates the datbase and assign username and password to it for you.

and it would all depend on what serverside language you use for #2

Shaolins-Finest
04-14-2006, 10:44 PM
well your host generally creates the datbase and assign username and password to it for you.

and it would all depend on what serverside language you use for #2Ok, thats great.
I think I'll use PHP. How would I connect it to the database and extract the correct information?

scoutt
04-15-2006, 01:56 AM
read the php manual for mysql_select and mysql_query.

Shaolins-Finest
04-15-2006, 01:36 PM
read the php manual for mysql_select and mysql_query.Sorry for sounding so stupid, but where can I find this?

-i-dont-know-
04-15-2006, 03:26 PM
Here is the basic php I use for querying a mysql database:

<?php
$host = 'localhost';
$user = 'root';
$pass = 'password';
$db = 'base';

$connection = mysql_connect($host, $user, $pass)
or die ('Unable to connect!');
mysql_select_db($db) or die ('Unable to select database!');

$query = "MySQL query here";

$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
?>

You can import the variables at the top using an include/reqiure to save having to re-write them on every page.

scoutt
04-15-2006, 10:13 PM
Sorry for sounding so stupid, but where can I find this?
mysql_query
mysql_select_db

everything can be found at www.php.net