Skip to content
Advertisement

Tag: mysql

How to cache BLOB type in Laravel

Hi everyone, Is there a way to cache BLOB types temporarily in Laravel ? Scenario: I’m gonna cache some data MEDIUMBLOB with the size of 2048KB temporarily. These data are actually parts of a large single file 16MB. After caching all parts, they will be combined together into a single file, then will be removed from cache. The content of

Laravel DB Query WHERE date greater than not working with JOIN

Background I have written a SQL query that works perfectly for my needs, and I am trying to add it to a queued job in Laravel. Instead of using Eloquent models I wanted to go with DB Query to ensure better performance as there will ultimately be many joins and conditions. I am having a problem with the where clause

How can drop colum in table

Is this query is correct? I’m using Laravel 8, and I want to drop a column in a table. But this query isn’t working. Answer you should use To drop a column, you may use the dropColumn method on the schema builder blueprint: first, you can create a migration file: then, in that migration, make sure you code will be:

New lines HTML if value changed in MySql Output via PHP

This is the HTML/PHP , I am using to display some data. and I am getting the data like this from the db. This outputs a single table with all the data. My question is , is there a way to break the single table into tables when the value of postid changes? It goes like..is 1 for x number

Import values from temporary table to another table?

I’m joining 3 tables: Currently, I’m fetching the data, build a new array and insert it into my final table. However, I wonder if it’s possible to do this in one go, so basically directly from the temporary table? Answer Yes. Use INSERT . . . SELECT: Note that I introduced table aliases. These make the query easier to write

Update multiple in one query in mysql

I have a problem on how can I update multiple in mysql in just one query the flow here is just like these. This will work and runs correctly What I’ve tried But the problem, it update all of my records into null even if the value of each column is not equal to 0000-00-00 since I’ve been using OR

Advertisement