
What databases does php support (which database interfaces does it have) (recommended learning: PHP video tutorial)
1 | Adabas D ,InterBase ,PostgreSQL ,dBase ,FrontBase ,SQLite ,Empress ,mSQL ,Solid ,FilePro(只读),Direct MS-SQL ,Sybase ,Hyperwave ,MySQL ,Velocis ,IBM DB2 ,ODBC ,Unix dbm ,informix ,Oracle(OCI7 和 OCI8),Ingres ,Ovrimos
|
Copy after login
and above Databases are supported. In short, most mainstream databases are supported.
php native operation method of mysql database
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <?php
require ( "../../public/dbconfig.php" );
$link =mysql_connect(HOST,USER,PASS) or die ( "数据库连接失败" );
mysql_select_db(DBNAME, $link );
mysql_set_charset( "utf8" );
$sql = "select * from users" ;
$res =mysql_query( $sql , $link );
while ( $user =mysql_fetch_assoc( $res )){
echo "<tr align='center'>" ;
echo "<td>{$userstate[$user['state']]}</td>" ;
echo "<td>{$user['username']}</td>" ;
echo "<td>" . date ( "Y-m-d" , $user ['addtime']). "</td>" ;
echo "<td>
<a href='edit.php?id={ $user ['id']}'>修改</a>
<a href='action.php?a=del&id={ $user ['id']}'>删除</a>
</td>";
echo "</tr>" ;
}
mysql_free_result( $res );
mysql_close( $link );
?>
|
Copy after login
The above is the detailed content of What is the php database interface?. For more information, please follow other related articles on the PHP Chinese website!