iOS 5 Lion: mysql_connect(): php_network_getaddresses: getaddrinfo failed:

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • westdh
    New Member
    • Nov 2011
    • 1

    iOS 5 Lion: mysql_connect(): php_network_getaddresses: getaddrinfo failed:

    <?php
    mysql_connect(" http://localhost","roo t","root");
    mysql_select_db ("cmi_test") ;
    ....
    ?>

    Warning: mysql_connect() : php_network_get addresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/denniswest/Documents/JQueryMobileSit e_65/www/ajax.php on line 4

    -------------

    Forbidden

    You don't have permission to access /ajax.php on this server.

    Apache/2.2.20 (Unix) DAV/2 Server at localhost Port 80
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you don’t connect via http. hence mysql_connect(" localhost","roo t","root");. but I recommend to use PDO or MySQLi instead of the outdated mysql_* functions.

    PS. you don’t connect via the root account either, because anyone who applies SQL Injections is able to delete your database or perform other unwanted adminstrative tasks. therefore connectio´ng through a standard user account which only has select/insert/update permissions is more secure.

    Comment

    Working...