Skip to content

Tag: mysql

Array PDO to MYSQL

so i’m trying to get each amenity entered with fav_id but every time i get these two errors i tried with if before foreach() but still get the same two errors i get these two ERRORS Notice: Array to string conversion on line 54 Warning: Invalid argument supplied for foreach() on line 57 Answer This line…

How to get multiple tables and show them in JSON

I have these tables in MySql The output should be like this This code gives me data of one table only I’m new with PHP so I hope someone shows me how can I do it like above. Thank You……………………………………………&#…

Display items with id from an array

So i created a column in my database that accepts JSON array, inside these array are item id’s , i want to create a loop on those ids and insert it in an sql select statements to display all items that has the ids in the array, but im clueless on how to do it. Answer As you are storing

On duplicate key update – implode $row_arr

I have a script in php that writes to the mysql array: $nr_order is the same for all plu in this order. Works correctly. Adds what you need to the database. I would like to do INSERT ON DUPLICATE KEY UPDATE on the same principle I wrote something like this: But this solution writes nothing to the database and…

Image Blob not adding to the mySQL Database

So I tried so many times and tried changing things and still not working, It still add and throw null here’s the code of the HTML, PHP and also JS (just incase needed). I already tried to do some of the methods on github and stack overflow and still doesn’t work. I hope someone can help me with th…