I’m working with multiple controllers where I receive inputs in camel case format and I need to assign these properties to a model: The problem is that my model has around 30 properties and I don’t want to write them one by one. I know that I can use the request to get all the properties: Is there a way
Tag: database
Laravel – Fetch data from other table column from linked key column
I have 2 tables. (1) being users, and (2) being foods. In the [users] table, there is a food_id bracket that is linked as a foreign key to an item/column’s id in the other table [foods]. I want to be able to go fetch data in that other column, via my user_id link in my [users] table. I don’t know
odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect
I have some problem in PHP using MS Access database, when I running the query in PHP show error odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect But when I’m going echo the “$query” variable and running the syntax in Microsoft Access is running well. And this is my query: And
Database connection not configured
I am currently doing a local project, using MAMP with PHP version 7.4.21 and I can’t seem to run my system because the database is not configured correctly. Here’s my .env and here’s my database.php Answer DB_CONNECTION is the driver that you will use
How to get user order data by specific month in laravel?
I want to user orders data by specific month in a year. Here is my order Table id | user_id | price | quantity | total Here is my order model Here is my user model In a controller, by doing this I get all user orders Now, How can I get specific month user orders detail? I want to
PHP login and registration – data not inserting into database (PostgreSQL)
Just trying to make a simple app where you can register and then login, going to find out how to do the logout, welcome pages later. Literally just want to post data to database by having someone type in a username and a password. I am new and have been trying to figure this out for days now. I don’t
Upload txt file using PHP into database and then return Excel file
What I need to do is upload txt file into databe using PHP, do some calculations based on that table, and then return result in Excel file. This code works well, but I’m not getting all data from the .txt file, since it looks like it stops when it finds a comma. Here is the code: And here is the
write in database (php/mySQL)
The problem is very simple (and everything, php and html is on one file(.php)) html part: the result is die(‘formulaire incomplet’);,and nothing is written in the database, i don’t see why. Any clue is welcome! thanks by advance Answer First, use the bound parameters method for all your data. Second set PDO to generate exceptions, then if the query does
One big update query, or several single update queries, to update a value in MySQL multi-tenant database
I’m working in a ‘point of sale’ application (PHP + MySQL), with products, sales, product quantity that have to be updated (+ or -) depending on the operation (sale/buy), etc. On every sale/buy, I save the operation data (date, customer, totals…) in an ‘invoices’ table, and the details (all products in the invoice) in a ‘invoicecontents’ table. Ok, you got
Updating and deleting from a data table, warning undefined array key
I have been following a lesson on how to make an admin page. I got all the information out of my database to a table on the page. I have an update button and when I change the information and press the button I receive this error: Warning: undefined array key “WebID” in ..Update.php on line 3 From my search