Skip to content

Tag: sql

rowCount for items over 45 days old

I have a table and use this to show me how many days the widgets have been in stock, this is the code I am using for this I have info boxes at the top of the screen giving me different widget info, what I wanted is one of these info boxes to give me a total of how many

Get a value from two tables

I am trying to get the value of the colum “name” from the clubs table. First table:(Clubs) id* name (what i need!!!) email password Second table:(club_posts) id club_id* zip_id kategory type stadt plz Controller: This is my query: The result is an array with ten values, but need only one. Answer C…

SQL select data based on a one to many relation

I struggle a little with the following database entity relations: I would like to create a query where I get all events for a user that is either the owner (item-user_id) or a participant (participant-user_id) I got back to native queries, cause they are more easy to try out. But the one to many relation betw…