Skip to content

Tag: mysql

Why do these two SQL queries return a different number of rows?

If I execute the following query in Workbench, I get back the expected number of rows — 5. However if I enter the same user_id in the search field of my web app it returns ALL orders, whether or not it has been refunded, but still lists the total number of refunds as 5. Any help is appreciated. Answer B…

Laravel Many to Many Relationship mixes up id’s in insert

I got the the problem, that the id’s of the FK’s for my pivot table get mixed up before insert and thus I get an error because a category with an ID that high isn’t available. Here’s how I try to insert: The Advertisement migration and class function: And here the category class functi…

How can I install Atta?

I’ve already install XAMPP and composer. My XAMPP is 7.4 and my composer is using composer 1. I’m not yet upgrading to composer v2. How can I install this project on my computer? The project seems to be located at https://github.com/erleiuat/Atta. Answer Steps to be done: Open git bash or terminal…

Order mySQL query by year with several year specifications

I am using this query to pull out article entries from my database: With single year specifications, the query orders the entries by year as intended: Problematic is that this older database uses several publishing years in the same table cell, looking like this: Example: 1970, 1974, 1983 or sometimes with se…

Flagging last overall row in MySQL query using LIMIT

I am retrieving results from a database in batches of 5, each time taking the last ‘id’ and returning it via jquery so only rows with smaller ‘id’ are returned. I have a load more button which should disappear after all rows are loaded, even if that means 5, 7 or 11 rows. I have this q…