Jump to content

again php mysql database connection


kadamsurekha

Recommended Posts

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

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.