English 中文(简体)
可能的话
原标题:Possible php mysqli bug
  • 时间:2011-10-19 19:47:30
  •  标签:
  • php
  • mysqli

我确信,这并不是ug笑,而是在我利用我的智慧来挽救成果的时候,我这样做:

$result->fetch_array();

mysqli_result Object (
    [current_field] => 0
    [field_count] => 1
    [lengths] => Array (
        [0] => 3
    )
    [num_rows] => 1
    [type] => 0
) Fatal error: Cannot use object of type mysqli_result as array

在查阅这些文件时,它要么归还一个阵列,要么放弃,而不是反对。 这难道是一种ug吗?

在研究这一法典时,应注意:

$query="SELECT * FROM table where id=  ";
$result=$link->query($query);
$row=$result->fetch_array();
print_r($row);
最佳回答

sample代码没有在PHP 5.3.4中复制这一问题(所有样本代码都应照做)。

。 根据这一和倾销的数值,请重新使用$result。 请使用<代码>$row。

问题回答

您必须把<代码>(单位:美元-和>;fetch_array()的回报价值分配给一个后来变成一个阵列或无效的变量。

e.g. $row = $result->fetch_array(); $row[0] etc etc.

http://www.php.net/manual/en/class.mysqli-result.php” rel=“nofollow”>mysqli 结果:

我的SQLi结果是:

系从查询数据库中获得的结果

在使用PHP阅读MySQL时,即使用:

$query = mysql_query("select something from something");
while($row = mysql_fetch_array($query)){
  $msql[$i]=$row;
  $i++;
}

并且现在,有两维面的薪-包,有选定的数值。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签