LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   mysql_connect in php file to a different socket path (https://www.linuxquestions.org/questions/linux-networking-3/mysql_connect-in-php-file-to-a-different-socket-path-876319/)

aocferreira 04-21-2011 06:53 AM

mysql_connect in php file to a different socket path
 
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '123';
$path = '/usr/local/test/mysql.sock'

$conn = mysql_connect($path, $dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'AHAH';
mysql_select_db($dbname);



mysql_close($conn);
?>

output: Parse error: syntax error, unexpected T_VARIABLE in /a.php on line 7

What's wrong? how do I correct this?

aocferreira 04-21-2011 07:02 AM

already fixed it. :)


All times are GMT -5. The time now is 11:49 PM.