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
Tag: mysql
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 the table above you can
I Can’t show my database tables through migration command on powershell terminal (Windows 10)
I tried to run: php artisan migrate Also to connect to MySQL using terminal on Windows. I Got this error: .env file: I tried to change my DB_HOST to “localhost” but it didn’t work. When I want to show databases it shows those; But even if I create tables like these it didn’t see As you see; I even delete
How to Insert multiple date entries (Date array data) at once for one client
I need to capture multiple date visits that a client makes at once from an HTML form. All the other data types get stored successfully but the date is changed into the default “1970-01-01”. Is there a way of converting the date array into individual dates as picked from the HTML Form to avoid the default dates and the error:
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 @TangentiallyPerpendicular’s comment, why are you binding to :orderedQuantity? This variable is not being
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 count() function, but this
Is there any way or method to concatenate while loop inside the string of HTML?
Is there any way to concatenate while loop inside the string? Basically, I need a string of HTML and there is some Metadata I want to retrieve from custom post type and want to store that data into HTML. thanks in advance for your help. Answer If you need to return html code, we can form that code first, put
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(‘user.id’, ‘user.name’)->get(); However my friend who is doing the frontend want the following
php artisan db:seed [ErrorException] count(): Parameter must be an array or an object that implements Countable
I am new to Laravel, i am seeding into a table called “area” in a database. Please this is an open source project I am learning with. Below is the code that gives the above error. Please don’t close my question, I have research anywhere I could for help. I am seeding into the “area” table with the columns: name,
How can I update json column with a correct data type with PDO?
I have MySQL 5.7 and a query with PDO: But after it I’m having: id data 1 {“old_field”: 2, “new_field”: “1”} Why does my new value have a string type? Expected table: id data 1 {“old_field”: 2, “new_field”: 1} I have success without using PDO(JSON_OBJECT(‘new_field’, 1)), but I have a string type with using placeholders. Answer When you pass an