HELP!!!

Associate
Joined
5 Mar 2010
Posts
572
Location
Eastbourne / Cape Town
Hey guys basically im so stuck, im creating a website with a database using phpmyadmin, im currently trying to figure out how to link the database to my registration page.. im using xamp and putting files into the htdocs folder but even with putting in

<?php

$db_host = "localhost";
$db_username = "root";
$db_pass = "";
$db_name = "register";

@mysql_connect ("$db_host","$db_username","$db_pass") or die ("could not connect to the database");
@mysql_select_db("$db_name") or die ("No database");

echo"Successful connection";

?>

its not showingg a preview... any ideas?
 
Try:

PHP:
<?php 

$db_host = "localhost";
$db_username = "root";
$db_pass = "";
$db_name = "register";

mysql_connect($db_host, $db_username, $db_pass) or die ("could not connect to the database");
mysql_select_db($db_name) or die ("Could not select database");

echo "Successful connection";

?>
 
i dont think its the code tbh because i can make a seperate file in the htdocs folder using the code and it connects to the database.. problem comes when i put it into an already created page in dreamweaver...
 
i dont think its the code tbh because i can make a seperate file in the htdocs folder using the code and it connects to the database.. problem comes when i put it into an already created page in dreamweaver...

Check that Dreamweaver hasn't added and code in the background ....
 
had a look and everything seams fine... its getting well annoying... does the sql php page need to be in same directory as the dreamweaver site or can the include php have a link to another folder and still work?
 
Back
Top Bottom