Questions tagged as 'mysql'

3
answers

Delete all tables except some mysql

I have a bbdd mysql with 65 tables and I need to create a script that will clean it for a future upload to production. As I have to delete most tables, except internal data (types of users, sections, permissions, predetermined categori...
asked by 25.01.2016 / 10:24
2
answers

About DEFAULT CURRENT_TIMESTAMP!

Good afternoon everyone again, Guys now I'm fighting with default insert the date in a table of my mySql. Table Appointment. Of course, the client does not have to enter the date, but I am interested in knowing when the appointment request was e...
asked by 02.06.2016 / 21:25
1
answer

Doubt with a MYSQL query

As the title says it is a doubt because I'm not sure it can be done, but hey, there it goes: Let's say that I make a join of two tables, one has ads (spots) and the other ad units, the query looks like this: SELECT Blocs.Numbloc, Spots.Nom...
asked by 27.04.2016 / 19:54
2
answers

Add data from an array obtained from a WhereIn laravel 5.6

Good morning friends, I have this question of how to add these elements taken from several queries The result that shows me is this: [{"s1":15},{"s2":12},{"s3":5},{"s4":7}] What I need is to add them and then pass them to a view. This is...
asked by 04.09.2018 / 01:46
2
answers

Show data related to a foreach in Laravel?

I have two tables one called " Events " and another one " Dependences ", a dependency can have several event , that's the relationship between they, what I try to do is show the data of a event , but also show the data of the dependence to w...
asked by 16.09.2018 / 05:21
2
answers

Convert TIMESTAMP field to time

I have a field TIMESTAMP in a field of a table in MySQL. TimeStamp 7/31/2018 5:58 7/31/2018 5:58 7/31/2018 5:57 7/31/2018 5:57 7/31/2018 5:55 I know how to format the field to be able to separate dates and time in Hours, Minutes...
asked by 13.09.2018 / 05:21
2
answers

how can I return a different value according to the results of a query?

I have a query that in the sex part I throw it in Boolean, but I want that when I return 0 I'm a girl and when I'm 1 I'm a boy. SELECT Persona.Id, Persona.Nombre1 AS 'Primer Nombre', Persona.Nombre2 AS 'Seg...
asked by 19.07.2018 / 15:18
2
answers

How to discount the days of the weekend

I have the following code where I count the differences of days, but I want to discount the weekends <?php $datetime1 = new DateTime($machine->fechasolicitud); $datetime2 = new DateTime($machine->fecha); $interval = $datetime1->dif...
asked by 12.07.2018 / 16:26
2
answers

How can I rename a file before uploading it to the server?

I'm doing a form that processes certain data, I'm using the following code, and I need to know how to rename a selected image, before uploading it to the server. That is, if when you select the image it is called imagen.png , rename it by...
asked by 05.08.2018 / 00:37
1
answer

The server requested authentication method unknown to the client [caching_sha2_password]

I have installed MySQL 8 and Laravel 5.6.18; when I try to execute the migrations with: php artisan migrate An example of my migrations is: Schema::create('categories', function (Blueprint $table) { $table->increments(...
asked by 15.05.2018 / 16:06