View Single Post
  #1 (permalink)  
Old 08-03-2007, 11:02 PM
HelloWorld's Avatar
HelloWorld HelloWorld is online now
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,118
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Icon13 [SOLVED] Database Connection PHP Still Doesn't Work, Please Help!!!

Here's all the code that I have and some screen shot that I have the database from phpMyAdmin:

admin/index.php
PHP Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin Login</title>
</head>
<body>
<?php
include 'config.php';
?>
<form action="<?php echo ($_SERVER['PHP_SELF']); ?>" method="get">
<!-- not yet implemented -->
</form>
</body>
</html>
admin/config.php
PHP Code:
<?php
$username 
'username';         // MySQL username
$password 'password';         // MySQL password
$host 'localhost';        // MySQL host

$db 'webtest';            // Database name

$link mysql_connect($host,$username,$password) or die(mysql_error());

mysql_select_db($db);        // Select database

// MySQL Query
$query 'CREATE TABLE mycms ('.
         
'id INT NOT NULL AUTO_INCREMENT KEY'.
         
'username VARCHAR(10) NOT NULL, '.
         
'password VARCHAR(10) NOT NULL)'
         
$result mysql_query($query);
?>
webtest database from phpMyAdmin
*attached*
Attached Images
File Type: jpg phpmyadmin_problem1.jpg (46.5 KB, 2 views)

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!