I came across a problem recently that I have to make a find(all) query in cakephp. Problem is I was unable to call model function to cakephp controller & add a command in function that would allow me to make a find(all) function in cakephp and retrieve all rows in a database that I was looking for. I would like
Tag: database
Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row:
during the realization of a project I encountered this problem can you help me please Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (bdd_sql.publications, CONSTRAINT publications_ibfk_1 FOREIGN KEY (auteur) REFERENCES utilisateurs (id) ON DELETE CASCADE ON UPDATE CASCADE) in C:xampphtdocsmini_projetclass.php:107 Stack trace: #0 C:xampphtdocsmini_projetclass.php(107): PDO->query(‘INSERT INTO pub…’)
How to update multiple or single row in single query using where multiple or single id using codeigniter?
I want to update multiple or single row in database in one query where multiple ids or single id post from the form. I couldn’t find it works in update batch. I don’t know how to do it. I have already searched on google on how to make it but I have no luck. Your answer is very much appreciated.
get post meta for all id [closed]
I want to get all brands from DB. It should work like get_post_meta( get_the_id(), ‘make’, true); but without id. It should contain an array with all brands. Which command I should use?
How to cache BLOB type in Laravel
Hi everyone, Is there a way to cache BLOB types temporarily in Laravel ? Scenario: I’m gonna cache some data MEDIUMBLOB with the size of 2048KB temporarily. These data are actually parts of a large single file 16MB. After caching all parts, they will be combined together into a single file, then will be removed from cache. The content of
Optimizing mysql query for better performance to get low execution time
Currently I have this mysql query in my php code. I want to optimize it better because this query is currently inside a while loop and this query alone takes 25 seconds. so the bigger the loop the time it takes to execute this query over and over starts to become insane in only a short time. So I would
PHP MySQL User Profile Page
I have a PHP login/register system and it’s working fine. I also have a profile.php page which is used to show the currently logged in user’s informations. For now, I want to do this, if the user is logged in and goes to profile.php, they will see their own profile page with their informations, but if the user navigates to
How to ensure, that column names are equal in laravel?
I am currently working on a laravel php project. In this case, a table containing countries should be created. There are three fields within the table: a short country code column called country_code and the name of the country in german and english language in the columns country_name_de and country_code_en. This results in the following model class: Further, there is
How to display unique results from an array with two conditions
In $data I have the following values: Result I want unique results for id and id_orders. I want 3 out of these 9 results. I have tried this, but it helps on one id_orders condition. PHP code Do you know how it can be different to make it work for two? Answer You can do it by keeping track of
The best way to to handle large databases in python/flask projects
Recently i started to use flask and I liked pretty much. In the past I had a system in PHP with a lot of databases like marketing, HR, finance and so on. Each of this databases had their own tables like HR used to have employers, companies and so on. Each of this tables was a class in PHP, we