Skip to content
Advertisement

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 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

Advertisement