xanie Posted January 10, 2013 Share Posted January 10, 2013 can someone help me with this one Parse error:syntax error,unexpected 'or' (T_LOGICAL_OR) in config/db.php on line 2 here is my code.. tnx <?php $db=@mysql_connect('localhost', 'root', '')or die (mysql_error()); mysql_query("SET NAMES 'utf8'"); @mysql_select_db('ozlo',$db)or die (mysql_error()); ?> Link to comment https://forums.phpfreaks.com/topic/272925-parse-errorsyntax-errorunexpected-or-t_logical_or/ Share on other sites More sharing options...
Dharmender Posted January 10, 2013 Share Posted January 10, 2013 Try like this $conn = mysql_connect( $serverName, $uid,$pwd); if (!$conn) { die('Could not connect: ' . mysql_error()); } $select=mysql_select_db($databasename,$conn); if(!$select) { die('could not select db'.mysql_error()); } Link to comment https://forums.phpfreaks.com/topic/272925-parse-errorsyntax-errorunexpected-or-t_logical_or/#findComment-1404581 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.