I have a form with that table: jsfiddle In this form i need to enable to edit the number fields. After submit i collect the data and write to mysql. Before mysql insert i want to check that the $number array does not contain the same numbers and zero (like: 0,1,1,101,150). If yes give an error to the user tha…
Tag: mysql
Decimal are converted to String in Laravel, cast is not working
I have a problem changing data type column in my table, from double to decimal each (6,2). Olso trying to $cast the variable to float, I’ve tried to cast olso as decimal, but nothing change, nothing change: if I dd $this in my resource I got this: The data back to be a number only if I rollback the data
How to upload file into folder after saving form
I am trying to upload files through this form but it’s only saving the name of the file into the database. I want that when the form submit then the file is uploaded to the destinated folder and the form submitted successfully, below I have provided both view and controller code Form view code: Form con…
PDOStatement::execute Values doesn’t work with WHERE Condition & HAVING Condition
i have a erreur PDOStatement::execute Values with WHERE Condition & HAVING Condition in same requette how i can make execute preparing value in both of theme WHERE, HAVING Erreur : Invalid parameter number: number of bound variables does not match number of tokens Answer you first have a problem in your m…
AWS does not load PHP webpage wherever I try to connect to database
I’m new to AWS and I’ve tried deploying my web application but keep getting 504 Gate-way Timeout. However, after a bit of debugging and redeploying, I noticed that this was being caused by the PHP segment of my index.php file: In particular when I removed everything before the session_start(); lin…
Race condition with multiple updates PHP & MySQL
I have a table called cards, Each user can create/have multiple cards. One of the cards must be set as default. Sometimes when a user performs multiple requests to set another card as default at the same time, In the end, There are two or more default cards. Initial table: id user_id is_default 1 50 0 2 50 1 …
Is there a way to decrypt a NULL text?
I am new to phpmyadmin and mysql. I have created a localhost WordPress community website where users can upload posts. I need to get access at the text of every post they upload via phpmyadmin because I want to connect the website with an android app. What I can’t figure out is why the text field is sho…
preg_match_all loop for each match, verify if empty to set null values to insert in table mysql
I have 10 lines to extract from file text with other lines, some are empty but exist, others don’t exist but I have to insert them anyway, with regex can split text by 10 group, I use preg_match_all to match group and generate a array with matches, but if the lines not exist not matched, I want insert v…
Creating an auto incremented id when user submits a form
Currently I have a refno. column in my database with the format LP00001. Now I have a add page that inserts all data that the user inserts in the input field and all this data gets sent to a table in my database, but my refno column stays null which I want to have an auto incrementing value where the
User Redirection accordingly an enum input. PHP code
I’m trying to redirect the logged-in user to a different page according to the enum input was stored at db. I was trying those lines, but it always redirects me at pro.php. How can I do this with the right way? What is the issue with the code? Here is my table definition: # Name Type Null Default 1 id