iarp Posted May 6, 2008 Share Posted May 6, 2008 On one of my pages i have <?php site_name(); ?> I get the error: Notice: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /homepages/31/d204952132/htdocs/iarp/includes/session.php on line 65 the function site_name() is: function site_name() { include_once('../includes/mysql_connect.php'); $query = "SELECT site_name FROM " . TBL_CONFIG; $result = mysql_query($query) or trigger_error (mysql_error()); if ($result) { echo $page_title; } mysql_close(); } Can you not call a mysql database in a function? Link to comment https://forums.phpfreaks.com/topic/104367-function-cant-connect-to-mysql-but-eveyrthing-else-can/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.