Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   PHP / mySQL (http://siteownersforums.com/forumdisplay.php?f=10)
-   -   Data Store in MySQL (http://siteownersforums.com/showthread.php?t=56419)

alen12345 04-16-2012 04:43 AM

Data Store in MySQL
 
How Data Stored in MySQL when i attached MySQL to PHP Websites?

henryc10 10-30-2012 07:38 PM

first you need to create connection to the database

mysql_connect(servername,username,password);

below is an example we store the connection in a variable ($con) for later use in the script. The "die" part will be executed if the connection fails:

$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

// some code

mysql_close($con);
?>

mysql_close above will close the connection automatically when the script ends.

Kunalmathur 04-30-2013 06:30 AM

thanks for given information...


All times are GMT -7. The time now is 01:31 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.