Skip to content
Advertisement

Tag: mysqli

using “INSERT INTO” statement in php code doesn’t work

I’m trying to build a database for a bookstore with 3 tables: Book, Volume and Publication. I’m using mysqli() and the code neither works nor echoes any errors. Answer The problem is that you are checking with === TRUE. As PHP Manual says: Returns FALSE on failure. For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a mysqli_result

Populating MySQLi result into a PHP indexed array

I need to load result of a mysqli select statement (single field with multiple rows) into an array like: As you can see I used the fetch_array(): but on printing r the $posts is creating something like this (looks like an array in array): How can I fix this to have something like: Answer As mysqli_result::fetch_array() will always return an

display multiple value of same column in mysqli php

I want to display value in checkbox. i have multiple value in database as shown in pic above. please have a look. I want value in different checkbox not in same checkbox ]1]2 Code I am trying and what i tried by myself Getting this error after trying code Answer I think this is what you need.

Docker PHP MySQL connection refused

I am trying to run a site using multiple container configuration – one for apache, second for mysql and third for myadmin. Everything starts fine, setup runs smooth but when I try to run a PHP application I get mysqli::__construct(): (HY000/2002): Connection refused in system/libraries/drivers/Database/Mysqli.php [54] error. It seems that there’s something wrong with the connection settings but I checked

Advertisement