in my project statistics about charts are displayed. One of the data is the number of hits on the website from this week and from the last week. Both are currently in their own line charts. There …
Tag: mysql
Illegal offset type when assigning Permission into Role in spatie/laravel-permission using UUID
I have implemented laravel-permission to custom my Model using UUID primary key. Then I created a seeder: But, when I’m trying to assign the permission to the role using: It shows error like this when I run the seed ErrorException Illegal offset type at vendor/laravel/framework/src/Illuminate/Database/E…
How can I select data from this week using a Unix timestamp in SQL?
I have two columns in my database named dtp_s and dtp_e. Both of these columns hold strtotime() formatted ints which I then use in my PHP application to calculate hours/minutes between time intervals. I want to display the 5 most recent records in date order, which works fine when I use this: However, I now w…
Inserting data in diferent tables
Im trying to add data to diferent tables in MySQL, but at the moment of run my code, it shows me a error is it “Fatal error: Uncaught Error: Call to a member function query()”, is the firs …
how do I get nested pojo result from php mysql
How to get nested pojo result like this one, This is I got from somewhere I forgot, but it has no code for make this result. with my code like this the result of mine like this Yeah I know it’s somekind old question, with many of questions similiar to. But I have no clue at all. I appreciate any
Dynamic dropdown Ajax PHP request
I’m trying to make a dynamically populated drop down in a form for location selection. I have scoured stack in other posts that ask similar questions and some websites but my second dropdown is always blank. The first dropdown is populated via a MySQL query. Form section Ajax request ajax_county.php Dat…
Duplicate checkbox remove in php
I have two tables named bookings and packages. Checked checkboxes are retrieved from bookings table and are working perfectly. But I also need unchecked check boxes from packages table. The problem is checked checkbox values display again. Answer You shouldn’t have two loops. You should only create the …
MySQL, PHP – WHERE clause
I create query as below, but I have a problem with WHERE part: So if I have products i.e.: DB Fiddle APPLE belonging to the categories: FRUIT, GREEN, ROUND WHEEL belonging to the categories: MACHINES, BLACK, ROUND BANANA belonging to the categories: FRUIT, YELLOW, CUBOID PHONE belonging to the categories: ELE…
Update about 1 million rows in MySQL table every 1 hour
I use Codeigniter 3.1.11 and have a question. I need to update about 1 million (in future will be much more) rows in MySQL table every 1 hour by Cron. But problem is if I update more than about 200-300 rows using this code, my server CPU is 100% loaded and table is stopping update after about 200-300 rows. An…
opencart error Fatal error: Uncaught Exception: Error: Unknown column
So first of I apologize for my rocky explanation. My PHP skills need serious refinement. I did get this error Fatal error: Uncaught Exception: Error: Unknown column ‘is_unlimited’ in ‘field list’Error No: 1054INSERT INTO oc_seller_group SET product_id = ‘1202’ ,gquantity = …