I deploy a laravel project on an apache server on a Debian 10 machine. The database is an MySQL deployed on another debian 10 machine on the same network. I can go to the connection interface of the application but when I connect this error appears : I have already tried these commands : these commands work but do not
Tag: mysql
How to solve Laravel cant connect with mysql through docker
Im trying to deploy my laravel app using docker. Then I created docker-compose.yml file and Dockerfile like below. docker-compose.yml Dockerfile And when I try docker-compose up, all the containers run with a any error. And also when I run docker-compose ps, it shows like this, But, when laravel application, tries to connect with mysql, it doesnt happens. And even I
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
How to change a value between 2 words with IF() in Mysql?
I am trying to change a value between on / off in a table using this code: But it is not working correct and I get this error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near
Insert data in a different table sql/ php
Could you please help me i have two different tables table tbl_users: table travail: I put idjob as a foreign key .* And I want to insert the value of job in the user table and i don’ know how the following code of “job” section register.php: Users.php: Answer In your register.php, it would be way more practical to have
Post Method only posting last value fetched from database
I am displaying list of items(multiple entries) from database on one page. I am trying to post all those values fetched from the database to another php file to add item to cart. But when I press ‘add to cart’ button for any item in the list, it is only sending last item through POST. I know it is because
How to insert the php array into another array using a loop?
I tried to run it like this and got an error, so not sure if I can set each of the array elements “y” as one of the amounts and “label” as a unique date like this Answer Try it as following:
File uploading with php: problem with $_POST[‘filename’]
I want to upload files from my Android app to my php server (through a https upload URL) Here is my php code : The content of $_FILES[‘uploaded_file’] is: So everything seems ok as I get the name of my file and its correct size. But when I log $_POST[‘filename’], I get a null string. How is that possible ?
How Can I correct Broken WordPress Permalinks
I have run into a problem with my WordPress blog. Previously, I could access pages using URLs like https://mywebsite.com/index.php/all. However, something unexplainable happened such that this URL has been renamed to https://mywebsite.com/?page_id=102. I have tried to change the permalink structure under settings and the link breaks. When the link appears as https://mywebsite.com/all it does not load in the browser. When