php5升级到php7的一些记录
<?php
//$mysqli=mysqli_connect($db_host,$db_user,$db_pwd,$db_name);
$mysqli=mysqli_connect($db_host,$db_user,$db_pwd);
mysqli_select_db($mysqli,$db_name);
if(!$mysqli){echo mysqli_connect_error();}
die(version_compare( mysqli_get_client_info($mysqli), “8.1.0”, “lt” ));
echo mysqli_escape_string(“select * from user where name=’gwegew'”);
die(‘xx’);
$res=mysqli_query($mysqli,’select * from xueli limit 1′);
echo “<pre>”;
/*
$array = mysqli_fetch_array($res);
var_dump($array);
foreach ($array as $val) {
echo current($val).'<br>’;
}
$finfo = mysqli_fetch_field_direct($res,1);
printf(“Name: %s\n”, $finfo->name);
printf(“Table: %s\n”, $finfo->table);
printf(“max. Len: %d\n”, $finfo->max_length);
printf(“Flags: %d\n”, $finfo->flags);
printf(“Type: %d\n”, $finfo->type);
*/
/*
$res=$mysqli->query(“INSERT INTO `xueli`
VALUES (
’24’, ‘xueli/201609/Cjaic91eUSR5zhl1308.jpg’, ‘ceshi’, ‘2’, ‘1139414400’, ‘1473091200’, ‘1475164800’, ‘网络教育’, ‘专科’, ‘兰州大学’, ‘甘肃省’, ‘建筑工程技术’, ‘网络教育’, ‘1073 0720 1606 0026 26’, ‘毕业’, ‘0408 7826 1126’, ‘1474128000’, ‘1538236800’, ‘1’
)”);
var_dump(mysqli_insert_id($mysqli));
*/
//var_dump(mysql_fetch_array($res));
//var_dump(mysqli_num_rows($res));
//关闭连接
//mysqli_close($mysqli);
//echo ‘hello’;
?>
int mysql_errno ([ resource $link_identifier ] ) int mysqli_connect_errno ( void )
int mysql_error ([ resource $link_identifier ] ) int mysqli_connect_error ( void )
bool mysql_close ([ resource $link_identifier = NULL ] ) bool mysqli_close ( mysqli $link )
bool mysql_ping ([ resource $link_identifier = NULL ] ) bool mysqli_ping ( mysqli $link )
int mysql_num_rows ( resource $result ) int mysqli_num_rows ( mysqli_result $result )
array mysql_fetch_array ( resource $result [, int $ result_type ] ) mixed mysqli_fetch_array ( mysqli_result $result [, int $resulttype = MYSQLI_BOTH ] )
array mysql_fetch_assoc ( resource $result ) array mysqli_fetch_assoc ( mysqli_result $result )
bool mysql_data_seek ( resource $result , int $row_number ) bool mysqli_data_seek ( mysqli_result $result , int $offset )
object mysql_fetch_object ( resource $result ) object mysqli_fetch_object ( mysqli_result $result [, string $class_name = “stdClass” [, array $params ]] )
array mysql_fetch_row ( resource $result ) mixed mysqli_fetch_row ( mysqli_result $result )
int mysql_num_fields ( resource $result ) int mysqli_num_fields ( mysqli_result $result )
array mysql_fetch_lengths ( resource $result ) array mysqli_fetch_lengths ( mysqli_result $result )
int mysql_get_proto_info ([ resource $link_identifier ] ) int mysqli_get_proto_info ( mysqli $link )
bool mysql_field_seek ( resource $result , int $field_offset ) bool mysqli_field_seek ( mysqli_result $result , int $fieldnr )
string mysql_get_client_info ( void ) string mysqli_get_client_info ( mysqli $link )
string mysql_get_host_info ([ resource $link_identifier ] ) string mysqli_get_host_info ( mysqli $link )
string mysql_info ([ resource $link_identifier ] ) string mysqli_info ( mysqli $link )
bool mysql_set_charset ( string $charset [, resource $link_identifier = NULL ] ) bool mysqli_set_charset ( mysqli $link , string $charset )
bool mysql_free_result ( resource $result ) void mysqli_free_result ( mysqli_result $result )
mysql_db_name SELECT DATABASE()
mysql_list_tables SHOW TABLES FROM dbname
mysql_unbuffered_query
mysql_pconnect mysqli_connect
mysql_connect mysqli_connect
string mysql_escape_string ( string $unescaped_string ) string mysqli_escape_string ( mysqli $link , string $escapestr )
string mysql_real_escape_string ( string $unescaped_string ) string mysqli_real_escape_string ( mysqli $link , string $escapestr )
string mysql_get_server_info ([ resource $link_identifier ] ) string mysqli_get_server_info ( mysqli $link )
int mysql_affected_rows ([ resource $link_identifier = NULL ] ) int mysqli_affected_rows ( mysqli $link )
bool mysql_select_db ( string $database_name [, resource $ link_identifier ] ) bool mysqli_select_db ( mysqli $link , string $dbname )
int mysql_insert_id ([ resource $link_identifier = NULL ] ) mixed mysqli_insert_id ( mysqli $link )
mixed mysql_query ( string $query [, resource $link_identifier = NULL ] ) mixed mysqli_query ( mysqli $link , string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
mysql_result
object mysql_fetch_field ( resource $result [, int $field_offset = 0 ] ) mixed mysqli_fetch_field_direct ( object $result , int $fieldnr )
mysql_field_flags
mysql_field_len
mysql_field_name
mysql_field_table
mysql_field_type
近期评论