2016-11-05 80 views

回答

-1

下面是一個簡單的例子就W3C

<?php 
$con=mysqli_connect("localhost","my_user","my_password","my_db"); 
// Check connection 
if (mysqli_connect_errno()) 
    { 
    echo "Failed to connect to MySQL: " . mysqli_connect_error(); 
    } 

// Perform queries 
mysqli_query($con,"SELECT * FROM Persons"); 
mysqli_query($con,"INSERT INTO Persons (FirstName,LastName,Age) 
VALUES ('Glenn','Quagmire',33)"); 

mysqli_close($con); 
?> 

發現谷歌是你的朋友。 ; )

對於日期格式,它仍然是PHP和MySQL,完全不用擔心mysqli

希望它能幫助。