我真的不明白为什么下面的东西会抛弃我(假)
// Create connection
$conn = mysqli_connect($servername, $username, $password);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
$sql = "SELECT id FROM maxims ORDER BY RAND() LIMIT 1";
var_dump(mysqli_query($conn, $sql)) or die(mysql_error());

答案 0 :(得分:1)
mysqli_connect("myhost","myuser","mypassw","mydb");
e.g
$conn = mysqli_connect('localhost','user','password','database1');