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…’)
Tag: mysql
Export Database & Zip it using PHP shell_exec()
I create a quick route that triggering an fn that runs shell_exec() to back up my database. To save server space, I also want to zip what I dumped I’m not sure why the zip command never runs even if I put a sleep() after the first one, and in betweens. What did I do wrong? Note : the tar
How can I change the selected option in select atribute using the php value that i have?
I want my select atribute to change it’s selected option depending on php $choice. For example if I chose FOOD ASC (it’s option 1) i want to make it selected after i press the button with name “sortbutton” HTML Answer I assume , the next page renders the same form again doing above on the html should work. I would
Retrieving data from pivot table in Laravel only using one foreach loop
I have created the 3-way pivot table for Users, Shifts, Patterns. It is called pattern_shift_user. [pattern_shift_user.][1] It refers to the three models via many to many relationships here’s a view of the user model that links the pattern model and shift model [User Model][2] I have done the same for each model, and it seems to work, the problem I
Is there any way to manage mysql users and get a database size in MySQL using Laravel Eloquent?
I’m currently making a hosting panel but I have some problems with the database management. Is there any way to manage(create/edit permissions/delete) mysql users and get a database size(MB) in MySQL using Laravel Eloquent? Currently using Laravel 8, thank you! Answer No this is not possible. Eloquent is purely a wrapper around queries for existing databases/users. If you need to
delete or undo the first query if the second query did not work
im confused about this. Is there any way like to test if all queries are working and not returning erros? if so execute them or return something. I am building a signup method, this have 2 parts: loginInfo(username, password) and the usual Employee info (name, email, etc..). The signup method inserts the Employee info into employee table, then it gets
Delete a HTMLtable row using AJAX
Frameworks used: JavaScript, AJAX, HTML. Cannot use JQuery Have to display SQL table on page Last column of the table should contain an image which acts like a delete button On clicking that delete image, the row should be deleted from HTML table and SQL table In my code the onClick is not working HTML code table rows displayed by
Sum of amount for each date having ‘type’ column in sql
I have table expense_incomes, the structure for table is: I want the sum of expenses and incomes in two different arrays groupBy date. I have tried this code. (In the above Example) I want to push expense into expense_array and income into income_array for 2021-04-02. What I am getting now: Expected Array Structure: Answer I believe you want an aggregated
The argument type ‘String’ can’t be assigned to the parameter type ‘Uri’. Flutter
I’m having a trouble, why I’m getting this error in my app flutter main.dart I just follow this reference link. It would be great if anybody could figure out, thank you so much in advance!. Here’s …
Populate database table with Laravel Faker from pre-populated table
I want to populate a table with listings of car offers with dummy data. The specific is that I want the make and model to be from a table already created in the database. Also the listing’s title to …