hisham
IS-IT--Management
- Nov 6, 2000
- 194
I used the following php script to test mysql connection via browzer:
<?php
$dbcon = mysql_connect("localhost:3306","myusername","mypassword"
if($dbcon){
echo " connected... ";
mysql_select_db("login",$dbcon);
$consult = mysql_query("Select * from users",$dbcon);
if($consult){
echo "consult OK <BR>";
$res = mysql_num_rows($consulta);
echo "No. of col. : " . $res;
}else{
echo "consult Error <BR>";
}
}else{
echo "No conecction.<BR>";
}
?>
when i run this script I get the messege:
Warning: Can't connect to MySQL server on 'localhost' (111) in /usr/local/apache/htdocs/abc/msql.php on line 2
Warning: MySQL Connection Failed: Can't connect to MySQL server on 'localhost' (111) in /usr/local/apache/htdocs/abc/msql.php on line 2
No conecction.
Thanks in advance for any help.
<?php
$dbcon = mysql_connect("localhost:3306","myusername","mypassword"
if($dbcon){
echo " connected... ";
mysql_select_db("login",$dbcon);
$consult = mysql_query("Select * from users",$dbcon);
if($consult){
echo "consult OK <BR>";
$res = mysql_num_rows($consulta);
echo "No. of col. : " . $res;
}else{
echo "consult Error <BR>";
}
}else{
echo "No conecction.<BR>";
}
?>
when i run this script I get the messege:
Warning: Can't connect to MySQL server on 'localhost' (111) in /usr/local/apache/htdocs/abc/msql.php on line 2
Warning: MySQL Connection Failed: Can't connect to MySQL server on 'localhost' (111) in /usr/local/apache/htdocs/abc/msql.php on line 2
No conecction.
Thanks in advance for any help.