Help - Search - Members - Calendar
Full Version: Beginner Site
Zymic Webmaster Forums > Zymic Free Web Hosting > Zymic Free Web Hosting - General Discussion & Help
Rahim
i m a beginner php/sql developer and want 2 to know about how to connect my fist page to my sql data base. i have done folowing so far but not succeeded.. plz help me..

<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'kundamore_zxq_net_rahim');
define('DB_PASS', '0000000');
define('DB_NAME', 'kundamore_zxq_net_phdir');
define('DEBUG', true);

$con = mysql_connect(DB_HOST, DB_USER, DB_PASS);

if(!$con)
{
// error connecting
if(DEBUG === true)
{
die('Database connection error: ' . mysql_error());
}
else
{
die('Failed to connect to the database.');
}
}

if(!mysql_select_db(DB_NAME, $con))
{
if(DEBUG === true)
{
die('Failed to select database, error: ' . mysql_error());
}
else
{
die('Failed to connect to database.');
}
}
?>

would i need to change my host form 'localhost' to zymic or any other??
Banjo
No you just keep it called localhost
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.