如何将此变为mysqli?如何将mysql_fetch_assoc更改为mysqli
// add meta_key to the query
$get_user_data = mysql_query("SELECT `meta_value`,`meta_key` FROM `table` WHERE `user_id` = $user_id", $link);
// use _assoc instead of _array, we do not need the numerical indexes.
while($row=mysql_fetch_assoc($get_user_data)){
$userdata[$row['meta_key']] = $row['meta_value'];
}
那你试试? – fejese
您可以从手册开始 - http://php.net/manual/en/mysqli.summary.php。 – panther