简体   繁体   English

PHP和MySQL - 准备好的语句不会返回特定的列

[英]PHP & MySQL - Prepared Statements won't return a specific column

I'm writing a website using PHP and MySQL and I'm using the following code to select everything from the table where ID is 0 or 1. 我正在使用PHP和MySQL编写一个网站,我使用以下代码从ID为0或1的表中选择所有内容。
However, when I dump $op it appears as an empty string even though in the PhpMyAdmin it's not. 但是,当我转储$ op时,它显示为空字符串,即使在PhpMyAdmin中它也不是。
All other columns are displayed as expected except this one. 除此之外,所有其他列都按预期显示。
Anyone know what's wrong? 谁知道什么是错的?

$stmt = $mysqli->prepare("SELECT * FROM `artikli` WHERE `id` = ?");
$stmt->bind_param('d',$id);
$stmt->execute();
$stmt->bind_result($id,$pl,$pr,$slika,$ime,$op);
$stmt->fetch();
var_dump($op);
$stmt->close();

Answer 回答

I figured it out guys. 我想出来了。
Free hosting is free for a reason. 免费托管是免费的原因。
I've downloaded the website to my local machine and now it works perfectly. 我已将网站下载到我的本地机器,现在它完美无缺。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM