To view the database port:
like ' Port ';
Keep in mind that each SQL End statement is followed by a semicolon.
You have encountered this problem when connecting to a database:
Fatal error:call to undefined function mysql_connect ()
Cause: The PHP extension is not enabled and cannot be used mysqli!
Workaround: Find it and remove the semicolon
Shortcut keys: ctrl+g find rows, ctrl+f find compliant, ctrl+h find and replace
To connect to a database:
File name: concat.php
Enter (your PHP file address to test) in the Address bar: http://localhost:8080/phpbin/concat.php
<? Phpheader ("Content-Typetext/Html;charset=Utf-8");//set the encoding $servername="localhost"; $username="root"; $password="root";//Create connection $conn=Mysqli_connect ($servername, $username, $password); Mysqli_set_charset ($conn,'UTF8');//Set character set//Detecting Connectionsif(! $conn) {die ("Connection failed:". Mysqli_connect_error ());}//Create a database $sql="CREATE DATABASElogin ";if(Mysqli_query ($conn, $sql)) {echo "Database creation succeeded";}Else{echo "Database creation failed:". Mysqli_error ($conn);} Mysqli_close ($conn);?>
A database was created:
= "CREATEDATABASE Login";
After the execution, you can go to the database to see
From this you can see that the database has been created!
MySQL Database re-use