Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 months ago. Improve this question I want to make a recapitulation of absent data, which I display using a table in CI. The pr…
Tag: mysql
Dynamically generate type definition string for prepared statement
I’m working on a script that is essentially loading data from an API into a local MySQL database. The values are variable depending on what is returned by the API. So far everything is working just fine up until I try to actually insert the rows into the MySQL db. Specifically, I know I should be using …
Laravel Join If Column Value Not Null
I try this method. I want to select discount if withCode value False. I try in where clause but in this method, if not false; I can’t access product. I want to select discount if withCode table FALSE. Else, I don’t want to select it Answer I solved with this codes;
SQL query JSON of MySQL 8.0 comes String instead of Array
I create a table in MySQL 8.0 as follows: It contains JSON type data, and I insert some data as: And I use php to visit the database, I wish to get value of “airline” as an Array. But it comes out a String, NOT an Array! This really annoys me, and JSON in MySQL is hard to understand. Answer
Get Error “Warning: Trying to access array offset on value of type null in”
Here’s the error I wan’t to add text “You” Before msg but it getting error. my php code : ($outgoing_id == $row2[‘outgoing_msg_id’]) ? $you = “You: ” : $you = “”; Answer i think this error returned due to the nullable of the $row2 this besides the wr…
Filled many Textbox with Select box using laravel
I want to display data in a text box based on the selected options. for example if If I select the title of the book, it will display the author of the book, the price of the book, the year the book was printed. I want to display the book based on the selected option chosen my Controller my Model
How to number a fetched rows from MySQL with a limit of 10 in an ascending order
I have this table that is fetched from MySQL but I have a column on my website where it says id number which is supposed to number the rows but I wanted to sort the rows so the ones with the highest value shows first but now the id gets scattered because the one with the highest value is not
Best way to run a SQL query for different dates
I have a PHP application that records the sessions of various devices connected to a server. The database has a table session, with the columns device_id, start_date, end_date. To know the number of devices connected on a given date, I can use the request : where :date is passed as a parameter to the prepared…
Laravel eloquent update, 500 Internal Server Error
I want to update my database with Laravel eloquent update, but response is always 500 This is my model This is the function This is the route Exception: Thanks before, for helping.. Answer Loking at the exception: Seems like you don’t have updated_at column in your database table. There are two solution…
Codeigniter loop to chunk query only ever gets the first chunk of rows?
I’m trying to get a large amount of data by grabbing it in chunks from the database and writing it to CSV. For some reason the code below is only writing the first chunk (2000 rows) to CSV. I have my $chunk and $limit variables writing to a text file, and those are going through the loop and writing out