I am trying to write an SQL query with PostgreSQL where I want to DELETE team_member_tag table record no longer presented in the array of $tags. The parameter is found in the tag table. tag table: id slug 3742 first-tag 3743 second-tag team_member_tag table: id team_member_id tag_id 89263 68893 3742 89264 68893 3743 The catch is that I should be
Tag: sql
SQLSTATE[42000]: Syntax or access violation: 1064 you have an error in your SQL syntax
hi am trying to run a sql query but it gives this error, i have reservations column in stores table and a reservations table which has firstname,lastname or email: code: Answer remove the “,” and that will solve your problem
How to use PHP’s ” .date(‘Y-m-d’). ” in a MySQL query in Where clause?
I have cloned a movie theatre project where the movie_carousel.php uses a query to fetch movies from the MySQL database. However it doesn’t fetch any data when I run it, only when I remove the entire Where clause from the query – then it fetches the movies. I believe it has something to do with the .date(‘Y-m-d’). in the script.
how to simplify this complex query
This is an extract of one of my php functions. I’m struggling to get this optimized as is super slow, as I need to load all interview records, and then check if the current user is either assigned as user_id on the interview record, or if the user->id is in the interviews shared_user_ids which is json I’m also using PostgreSQL
Laravel Eloquent where statement returns no attributes
So from my previous post, I was advised to start using Eloquent models, which I did. My end goal, is to print out specific gifts, that belongs to that specific box. Migrations: gift_items: gift_campaigns: Pivot table: Controller: Error that I receive using this way: Seems like the updated version is trying to call the gift_campaigns table id, instead of the
Date range loop into bbdd
I want to make different tables from 2 variables: start date and end date. Example: input start= 05/07/2022 input end= 07/07/2022 so, when I submit the form I want this result: ddbb: id:01 05/07/2022 id:02 06/07/2022 id:03 07/07/2022 I tried this but I got the dates displace, like this: id:01 06/07/2022 id:02 07/07/2022 id:03 08/07/2022 This is the code: Answer
showing contents of a table using PHP in HTML
I have this code snippet: and both inside submit.php, however, while the feedback table inside judges database is not empty, I don’t see any of the rows shown in the HTML page only the column name shows up in the Response tab of Network tab in Firefox Inspect tool. What do you suggest to populate the existing database into the
Resolve name by ID in from 2 tables in PHP / SQL in Datatable
I am currently working on my first datatable which I managed to get to work and I am quite happy with it, however I am having some difficulties in resolving client names. Here is my current code: Tablefile.html: And here my datatable.php file: The table renders fine and works great, however client_id is obviously just outputting their related ID’s, e.g.
retrieve rows based on parent relationship
This is the query: I am trying to get all the checklist items that have the same item_stock_id from the checklists that have the same ambulance_id. However, the query from above is not working, showing me this error: Below is the ChecklistItem model: And this is the Checklist model: Answer To constrain the eager load you need to specify the
How can I print this data in a HTML table with this format?
Imagine that you have this SQL query result: And you want to print a table taking into account the ID_KEY, like this: How can I do that? I want to print a new row when ID_KEY changes. For example, now I have this code: This code won’t work because “value1”, “value2” and “value3”, are fields that do not exist in