Skip to content

Tag: mysql

How to update mysqli field if the value is not empty

I am trying to update a specific value from my table getting them as row from a table let’s say the name but the problem is the image, cause i can’t pass a value to an input field type = file I need to update the value in the database only if there is a value to change if not

SELECT from database when i don´t know position of null values

Good afternoon. I need your help to make correctly query into database. I have following table in DB with adresses, eg. id street house_nuber city district 1 First street 1225 City One NULL 2 NULL 25 Small city NULL 3 Second street 51 Roswell District nine 4 Third street 15963 Last city Another district In th…

SQL query to update item quantity using PHP PDO

Good morning everyone I am trying to update the table with the new quantity selected, when I run the following function, however, I get this error: Function to update the quantity, function_products.php: product_update_process.php What could be the issue here? Thanks for your assistance. Answer To add to @Tan…

Get Count For A Set Of Fetched Field Values – MySQL / PHP

I have some data returned from a MySQL database that outputs the post details for a particular user. I’d like to output a count for the number of images (represented below by the $db_image_filename value). How do I get a count for the number of field values in a column? I thought I could use PHP’s…

How to get array in array with laravel and mysql database?

I am using Laravel (PHP) and MySQL for my backend. I am creating methods for setting and getting information from the database. Those information are being send as a json to the frontend. I can send table information like: For this I am using laravel methods like: DB::table(‘user’)->select(&#82…