Forum Moderators: coopster
In the following code, i expect to get the words
"Connected"
"Disconnected" in this order, the next one under the first one, but i am getting "Connected""Disconnected" on the same line (which i was not expecting)
How can I force it.
Sorry, i know it's very basic but becoming tricky.
Here is the sample code:
<?php
// connect.php-connect to the MySQL server
if(!$conn_id=@mysql_connect("localhost", "$user", "$pass"))
{
die("cannot connect to server\n");
}
else {
print("Connected\n");
}
if(!@mysql_select_db("some_database")){
die("Cannot select database\n");
}
mysql_close();
print("Disconnected\n");
?>