Here are two pieces of code why the execution results are different, help explain, thank you
$userName = "root";
$USERPWD = "1234";
$dbName = "Test";
$serverName = "localhost";
Connecting to a database
$conn =mysql_connect ("localhost", "root", "1234");
Select Database
$select =mysql_select_db ("test", $conn);
if ($select) {
echo "Database connection succeeded";
}
?>
Unlike the following code execution results, please analyze the following $userName = "root";
$USERPWD = "1234";
$dbName = "Test";
$serverName = "localhost";
Connecting to a database
$this->conn=mysql_connect ($this->servername, $this->username, $this->userpwd);
Select Database
$this->my_db=mysql_select_db ($this->dbname, $this->conn);
if ($this->my_db) {
echo "Database connection succeeded";
}
?>
Share to: more
------Solution--------------------
Join before the?>
}
New Login;