Jump to content

php mysql database connection


kadamsurekha

Recommended Posts

hello friends!

 

i want to add my form details to the mysql database.

i had done it with mysql_connect('localhost','root','');

but the error was localhost connection failed.

 

i tried with my site domain as below

 

<?php

$link = mysql_connect('mydomain.com', 'root', ' ');

if (!$link) {

  die('Could not connect: ' . mysql_error());

}

 

mysql_close($link);

 

?>

 

 

the error is

 

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in /home/httpd/vhosts/mydomain.com/httpdocs/wel.php on line 99

Could not connect: Lost connection to MySQL server during query

 

 

can any1 tell me wht is the pbm?

 

n how to add form data to the database using mysql n php?

 

 

 

thx

Link to comment
https://forums.phpfreaks.com/topic/41926-php-mysql-database-connection/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.