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…
Tag: mysql
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……………………………………………&#…
Update MySQL Database With Data From Multiple Input Elements Inside A While Loop, And A Single Submit Button Outside of The While Loop
I have a page that fetches images from a database after an initial upload, that allows the user to add titles and tags to the images. I have set the while loop to output the individual images inside one form. Each image has two related input fields. What I would like to do is have it so when the form
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…
How to create VIEW witch combined and filtraded result from multiple rows
Hi i have problem with task i need to do. I have a table in SQL showing log of users (subscibers) with triggers that add TIMESTAMP, ACTION PERFORMED and NAME of the subscriber, looks something like this: TABLE: audit_subscibers ID Name Action Time 0 John Insert a subscriber 2020-1-1 1 John Deleted a subscribe…
join tables and see the count of categories in each category name in laravel 8
excuse me want to ask. I’m sorry in advance if my language is not neat I have a category table with colom -id (pk) -name -and others and i have a post table with colom -id (pk) -category_id(fk) and others I want to count the number of posts from each category along with the category name in laravel 8. t…
Sort By date in hasMany relation first record for Laravel project [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 10 months ago. Improve this question I have a courses table and every course has many sessions, So I need to sort courses by th…
display the same form with new updated data after click on save button in PHP
I have a form that show the user information and when I load userpage.php all info appear in each field and user can edit his information all is good until the user click on save button, it have to show the same form with updated information, data updated in database but the new data doesn’t appear when…
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…