|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-14 12:35 UTC] georg@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 17:00:01 2025 UTC |
Description: ------------ When I use ($localhost="10.238.21.140:3306";)i.e. IP addr of my machine insted of 127.0.0.1 or local host .It gives following error : Warning: mysql_connect(): Can't connect to MySQL server on '10.238.21.140' (10061) in c:\program files\easyphp1-7\www\new.php on line 6 Unable to select database Reproduce code: --------------- <? $user="root"; $password=""; $database="mysql"; $localhost="10.238.21.140:3306"; mysql_connect($localhost,$user,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="INSERT INTO contacts VALUES ('','Pawan','Wattamwar','02234 567890','00212 334455','01224 567891','johnsmith@gowansnet.com','http://www.gowansnet.com')"; mysql_query($query); mysql_close(); ?> Expected result: ---------------- blank screen without any error and row inserted in DataBase. Actual result: -------------- Warning: mysql_connect(): Can't connect to MySQL server on '10.238.21.140' (10061) in c:\program files\easyphp1-7\www\new.php on line 6 Unable to select database