Hey guys,
I'm new to php / sql and all the fun that comes with it
But I bought a php book awhile back about how to make php based games, its very informative but lacking in some areas. It came with a cd and example files.
But I'm having trouble getting the database up and running, dont know where to get db.php or what to put in it
I created my own db.php and put code I found online in it. (Guess work)
<?php
//config file
ob_start();
//database info
$g_DBHost = 'localhost';
$g_DBUsername = 'root';
$g_DBPassword = '';
$g_DBName = 'example';
//end db info
//connect to db
mysql_connect($g_DBHost, $g_DBUsername, $g_DBPassword)
or die('Could not connect: ' . mysql_error());
mysql_select_db($g_DBName) or die('Could not select database');
//end connect
?>
Doing this stopped some of the errors I was getting, but now when i click login the page just refreshes.
Heres one error i get when trying to register a user.
fatal error: Undefined class name 'db' in c:\program\files\easyphp1-8\www\CLockTableCmd.php on line 11
Any help with this would be great, thanks
p.s : Go easy on me :queasy: