gpt4 book ai didi

PHP mysqli_fetch_array 缺少一些字段

转载 作者:行者123 更新时间:2023-11-29 13:19:23 25 4
gpt4 key购买 nike

我创建了一个存储有关船只信息的数据库,当我尝试在 PHP 中使用这些数据时,它起作用了,然后我向数据库添加了一些新字段,但是当我在 PHP 中使用它们时,它们返回“未定义索引:fieldName” .

据我所知,这意味着索引尚未设置,所以我检查了数组的内容,发现除了新字段之外的所有字段都在那里,但是我可以在 phpmyadmin 中查看它们。

PHPMyAdmin:看图片:https://dl.dropboxusercontent.com/u/65222600/phpmyadminshot.png

enter image description here

PHP 代码:

<?php
include_once "php/connect.php";
$result = mysqli_query($con,"SELECT * FROM vessels");
while($row = mysqli_fetch_array($result)){
print_r( $row );
}
?>

PHP 返回:

Array ( 
[0] => 1 [idVessels] => 1
[1] => 1 [userId] => 1
[2] => cams boat [name] => cams boat
[3] => 1000000000 [price] => 1000000000
[4] => 0 [VAT] => 0
[5] => GBP [Currency] => GBP
[6] => UK [Location] => UK
[7] => ME [builder] => ME
[8] => ME [make] => ME
[9] => ME [model] => ME
[10] => 10/10/13 [yearConstructed] => 10/10/13
[11] => 1 [cabins] => 1
[12] => 1 [heads] => 1
[13] => 1 [#engines] => 1
[14] => ME [engineModel] => ME
[15] => 100 [enginePower] => 100
[16] => petrol [fuelType] => petrol
[17] => 122 [nominalLength] => 122
[18] => 122 [overallLength] => 122
[19] => 122 [waterlineLength] => 122
[20] => 122 [beam] => 122
[21] => 122 [maxDraft] => 122
[22] => leather [hullMaterial] => leather
[23] => MINT [hullType] => MINT
[24] => MINT [keeltype] => MINT
[25] => 122 [displacement] => 122
[26] => 122 [waterCapacity] => 122
[27] => 2014-01-10 02:18:39 [dateAdded] => 2014-01-10 02:18:39
[28] => For Sale [status] => For Sale )

并且没有描述或primaryImageURL。

非常感谢任何帮助,谢谢

最佳答案

感谢所有帮助人员,事实证明我使用的是项目数据库而不是我的开发数据库

关于PHP mysqli_fetch_array 缺少一些字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21050697/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com