I am running a select statement in which it brings back multiple items of the field ‘task_name’ from records that contain a matching ‘username’ field to a PHP variable above called ‘$user_log’. $…
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
PHP Fatal error: Uncaught Error: Call to undefined function mssqli_fetch_assoc()
I have a database table called BRANDS and, one of the records, in the table, is called BRAND Here’s my PHP code: $db = mysqli_connect(‘127.0.0.1′,’root’,”,’ecomm’); if (mysqli_connect_errno()) …
How to display messages from the database on left and right?
‘I made a simple chat box with php but the problem is i want to display my messages on the right and the other user messages on the left i made two while loops but they didn’t work. My table is like this (Sender – reciever – msg) I want to display each message ordered by time and on different
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.
Is it safe to display SQL error messages on your website? (mysqli)
I was wondering if it’s safe to display the error messages mySQL(i) returns (if any) on your website, or should I do this differently? I have seen some forum arguments on MySQLi vs PDO and some say that it’s always safe to display MySQLi error messages, but since those are internet arguments, I don’t know how trustworthy that information is.
Is there a way to release mysql connections?
The thing is I have a cronjob that repeats itself every 2min & calls a php script which does some mysql query.. now that thing is making mysql very busy which in the process is consuming too much …
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
foreach loop populate array for call_user_func_array
I am using a foreach loop to populate an array with parameter types and parameter values before it inserts into the database. Everything works fine and posts to the db, but I can’t figure out why it …