selecting a database error
Posted: Mon Jan 05, 2009 2:59 pm
im a big noob and well im trying to select a database after connecting but i have a problem heres the code
this is the error i get
Parse error: syntax error, unexpected T_IF in C:\xampp\htdocs\sand\connection.php on line 7
Code: Select all
<?php
$connection = mysql_connect('localhost', 'root', 'password');
if (!$connection) {
die('Could not connect: ' . mysql_error());
}
$db_select = mysql_select_db("test", $connection)
if (!$db_select) {
die('database selection failed' . mysql_error());
}
?>Parse error: syntax error, unexpected T_IF in C:\xampp\htdocs\sand\connection.php on line 7