TLDR: Please point me to the SIMPLEST tutorial for my problem. I have read many tutorials but all they did was confuse me more. I have three tables. students (has a row of id and name) courses (has a …
Tag: mysql
Subquery in INSERT executed differently in PDO than SQL
I want to insert a new dataset into a MySQL table tab with external data, but also with data from another table otherTab using the others’ table primary key and another condition. However, it could be …
is there another way to get the image from DB to Dynamic Carousel?
I have seen many people have posted the same question but non of their answers have worked. I have used bootstrap to create a Dynamic Carousel that gets the image from the path that stored in the …
Character encoding issue with PHP/MySQL
I have a web application I have been developing locally on my computer, I have recently launched it on my web server with the exact same settings for MySQL, but for some reason I am encountering a character encoding issue where “smart quotes” (’) are being displayed as black triangles with questio…
How to fix “Array to string conversion” to display content from table as a checkbox description
I am creating a table with content fed from a table in a MySQL Database. One of the fields on the table is a checkbox form that adds roles to the user. I got it to work, but with the description being hardcoded. Since a new role might get added, I want to show it as a new checkbox option.
Inserting to multiple mysql table based on an primary key from first table
I am trying to write to two mysql tables. Table 1: vehicles The field vehicle_id is auto incremented. I need to use this field in the next table speed_log. This is the other table that. Table 2: speed_log As above, the id is auto incremented but I need to pick the vehicle_id from the first table when the scri…
Copy rows in MySQL table multiple times and adding additional column
I have created MySQL table in database. Table name is products and the columns are( prodict_id(pk) product_name and pack_size) as shown in the figure below. What I want to do is , copy all the rows …
IlluminateDatabaseQueryException: SQLSTATE[42S02]: Base table or view not found: 1146 Table  (truncated
I’ve created an API using Laravel v5.8. This API has one endpoint that recieve some parameters and create 1 row on a database table. When I call to this endpoint using Postman, it works. But… I’ve …
UPDATE MySQL record of selected value from dropdown list
I’m just learning MySQL/PHP and I’m trying to update a mysql record of a selected value from the dropdown list. I have read through several tutorials, and tried to apply them, but I cannot get this working… What I want : I got a dropdown list with two options (Approved, Disapproved). I want …
Laravel join tables with JSON field, when some fields have no foreign key
I want to join 2 tables by a foreign key stored in a JSON field. The field can be empty, so i get an error, i can not sem to get rid of. I have a model Transaction: the items field is json: now i want to join these tables for a query: The problem is, that i have many