简体   繁体   中英

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.
However, when I dump $op it appears as an empty string even though in the PhpMyAdmin it's not.
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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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