kadamsurekha Posted March 9, 2007 Share Posted March 9, 2007 hello friends! i want to add my form data 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('mobishoptalk.fritzdsouza.com:21', '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 line 99:$link = mysql_connect('mobishoptalk.fritzdsouza.com:21', 'root', ' '); my domain is mobishoptalk.fritzdsouza.com on port 21 can any1 tell me wht is the pbm? n how to add form data to the database using mysql n php? thanks Link to comment https://forums.phpfreaks.com/topic/41934-again-php-mysql-database-connection/ Share on other sites More sharing options...
skali Posted March 9, 2007 Share Posted March 9, 2007 try using : $link = mysql_connect('mobishoptalk.fritzdsouza.com', 'root', ' '); Port 21 is for ftp. Mysql default port is 3306 if you have not changed it on your server. Link to comment https://forums.phpfreaks.com/topic/41934-again-php-mysql-database-connection/#findComment-203312 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.