2010-08-14 104 views
1

$ result = $ conn-> query(“SELECT * FROM temp_users WHERE reg_code ='$ passkey'”);mysqli对象如何获取字段

这个工作:从print_r的

if($result->num_rows == 1){ 

值($结果);

mysqli_result Object ([current_field] => 0 [field_count] => 11 [lengths] => [num_rows] => 1 [type] => 0) 

$result->username其中用户名是数据库中的字段显示空白?

回答

2

您需要使用mysqli_fetch_array或相似。