Hello,
As i did not have the database, i'm using an online free database.
These people gave me the following info
http://www.freesql.org
port 3306
database name : xxx
user: yyy
password: zzz
How do i connect to the database?
how do i connect to a remote database
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Code: Select all
$db = mysql_connect("www.freesql.org:3306", "yyy", "zzz") or die("Cannot connect to database.");
mysql_select_db("xxx", $db) or die("Couldn't select database.");- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Firstly... make sure your free Hosting service doesn't have the mysql functions disabled. I know T35.com have them disabled for the free service.
If they're not then you just use
Voila. But check the functions are enabled first! 
If they're not then you just use
Code: Select all
$server = "www.freesql.org";
$user = "xxxxx";
$pass = "xxxxx";
$database = "xx";
$port = "3306"; //The default port so you don't really need to specifiy it
$connect = mysql_connect($server . ':' . $port, $user, $pass); //looks like http://www.freesql.org:3306,xxxxx,xxxxx
mysql_select_db($database);
mysql_close($connect); //at the end of using the db
?>- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
thread hijack - xmas
bleh
beautiful women cost a lot of money, so i gotta make lots of money
) and make some programs in http://euler.sf.net as a replacement for my math exam in january...
ah well, you can http://home.mysth.be/~timvw/demo (user: timvw pass: password) (packages -> select a package and choose maintain files -> choose create). the idea is that users can create packages, and those packages can contain files they have on their server.... we want to make it as easy as possible, therefore they only have to install 1 file on their server... and pass us the url of where that file is located...
beautiful women cost a lot of money, so i gotta make lots of money
ah well, you can http://home.mysth.be/~timvw/demo (user: timvw pass: password) (packages -> select a package and choose maintain files -> choose create). the idea is that users can create packages, and those packages can contain files they have on their server.... we want to make it as easy as possible, therefore they only have to install 1 file on their server... and pass us the url of where that file is located...