Skip to content
Advertisement

Tag: database

sql error while trying to store the image to database(UPDATED)

UPDATED: As suggested in comment section I have updated my code and using PDO now. I still have the same error. I am trying to store multiple images to the database (phpmyadmin). When I try to upload it gives an error Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘file.png’ in ‘field list’ My database: I have an database named

Laravel Eloquent ORM: Select from two tables without using find() possible?

Basically I would like to run a very simple database select query accross two tables in mysql considering a one-to-many-relationship. categories: This table contains all product-categories. The primary key is “id”. It has one column “url” which holds the string how to access this category, e.g. “greeting-cards”. products: This table contains all products whereas each product has one category id.

empty data in Laravel query

my response always empty ! if I run only one (where) separated in the Query I get data but if I run all three ( where ) Its empty ! my output Answer Change your controller code to something like this And if there’s an OR condition between branch and type then change your code like this

Error when saving data on a specific date and time

I have a server with Debian 10,Apache/2.4.38, MySQLi, mongodb and Php. The server is running a custom PHP program which allows users to upload their measurements (in .csv files) which are then stored in mongodb. The uploaded .csv files must comply with a predetermined format in order to be uploaded, like so: The timestamp must be set every 15 minutes

Problems specifying Laravel Eloquent database at runtime

Laravel 5.8. I am trying to save an Eloquent model, choosing the database connection at runtime: My config/database.php file: My problem is that each time I run this code, the cat is created in the mysql (default) database, rather than the staging database, even when USE_STAGING is true. Answer The problem is the static call of the create() method. By

Add Year to NOW()

I am trying to add a year to a date going into a SQL database from PHP. I have tried DATEADD(Year,1,NOW()) And various other forms but can’t seem to get it to add a year onto it in SQL. <?php …

Advertisement