Skip to content

Tag: mysql

Few, complex OR many, simple MySQL queries?

Im working on a onlineshop with php. I work with the mvc model and I divide each small part of my application in: model view controller and service ( service is there for the query ). So for example I would have a Item cart which is divided in discription and price… For each of them I would have a

Datatype date is not updating in mysql using laravel

A column named ‘Shipment’ in import_request_trackers table having the datatype of Date and initially the default value is null. But when I tried to update the column from another form manually it shows no error but the database table is not being updated. } Answer 1- check your route first, please…

SQL – Selecting a users conversation based on members

I am trying to formulate a query to select a conversation based on members passed in, this can be many participants. Users can have multiple conversation with the same users in, and they can rename conversations. Here is my messages members table: And the messages relation table: Messages table for reference:…

Eloquent relationship where not in sub-query

I have got a relationship where I select all row’s based on the category, however I need to exclude some of these if they are within a sub query. So above is my code, nearly works as I want it, however it seems that the $q variable doesn’t have the table name within the query, below is the query o…