Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 263
0 Users 7 Guests Online

MySQL Code

Code
<?php mysql_connect("localhost","username","password") or die("Cannot connect to MySQL Database");?>


or die() function gives you an erro.

Code
<?php @mysql_connect("localhost","username","password") or die("Cannot connect to MySQL Database");?>


The @ symbol is used to supress the error

Code

<?php
$host = "localhost";
$dbname = "";
$pass = "";
@mysql_connect( $dbname,$pass,$host ) or die ("ySQL Cannot Connect to the Database.);
?>




Tutorial on Creating Database
1) In your MySQL Databases part of the cpanel, you will see a box called New Database:[type your datbase name!!], then click create database.


2) Click go back and go down a bit more, you will see two more new boxes, Username and Password, type the username and the password, then click Create.


3) Click go back and go down to the Drop Down Menus. Click the arrow and put the name to the datbase. Then click on Add User to Datbase. You are now ready to use the codes above.
Joshua
Author:
Views:
1912
Rating:
Posted on Friday 9th February 2007 at 09:48 PM
Joshua
Joshua
Is mine good?

If so, thanks, this was actually one of the firsts I wrote.
Posted on Friday 9th February 2007 at 09:35 PM
DanielXP
DanielXP
I will have a look into my one.

Posted in the early days, you know what i mean.
Posted on Friday 9th February 2007 at 09:31 PM
Dean
Dean
yah ano it is . But still its already been posted :)
Posted on Friday 9th February 2007 at 05:06 PM
Nevram
Nevram
yes, but this is much better explained. lol
Posted on Thursday 8th February 2007 at 10:11 PM
Dean
Dean
Well daniel posted a tutorial similar to this.
Posted on Thursday 8th February 2007 at 08:41 PM
Nevram
Nevram
Lol im the biggest n00b. I never got it until i read this!:p