Questions tagged as 'php'

1
answer

Laravel create a multidimensional array

I have a query in mysql that returns a row of records like this, the first field is the marca and the second the modelo , what I try to do with PHP is to mount an array with the following structure to pass it in view of blade grou...
asked by 01.08.2018 / 13:01
1
answer

do a correct if else in MySQL procedure?

I have a condition that will be executed depending on the data that is being sent to the procedure. This is my code: CREATE DEFINER = erp@localhost PROCEDURE sp_stockProductoMovimientoAlmacen( idProducto VARCHAR(50), operacion CHAR(6),...
asked by 21.07.2018 / 16:34
1
answer

How to show the value of 1 of a check as a text

Change value = 1 to "Active" or value = 0 to "Inactive" if (isset($active) == 1) { $is_active = "Activo"; } elseif(isset($active) == 0) { $is_active = "Inactivo"; } Just as it shows all as Active and there should be one...
asked by 20.07.2018 / 16:51
3
answers

How to omit the first row of an xlsx file

I'm using SimpleXLSX to import excel files into my database, but I do not want the first line to be added, try using the continue but what it does is insert all the data in the table twice Here is the code if (isset($_FILES['file'])) { re...
asked by 19.07.2018 / 18:45
1
answer

Problem with select for PHP MYSQL JQuery price filter

I have a form which contains a select , to be able to filter by higher or lower price, when I select an option if it performs filtering, the problem is that the select never changes the option always stays in the first option. I...
asked by 06.07.2018 / 22:32
2
answers

Consult specific data of mysql omitting others in php?

I have a table with the following data id, name, price, category, description, but I want to make a query according to the category, for example, if I select the chairs category just print those rows that have that category in said column. I ho...
asked by 08.07.2018 / 15:25
1
answer

The best way to endorse a table by periods [closed]

I have a table ( tabla_1 ) that is constantly edited with certain values and I want to be able to keep a searchable record of these same data of their state in periods of time gone by. I am considering creating a second table ( tabla...
asked by 06.07.2018 / 22:31
1
answer

Download BD in several Excel

is that I have a site that downloads the bd in an excel file but the thing is that I arrive at so much data that the excel file arrives damaged, so it occurred to me that I could only upload, say, a thousand data and that when the thousand thous...
asked by 30.07.2018 / 22:01
1
answer

Match error with regular expressions in preg_match_all

The problem is that making a match of each occurrence of a character regex of the string returns everything well, but the first result always lacks the last character. $string = "@user#12458 y @user2#12345 son dos apariciones";...
asked by 30.07.2018 / 18:31
1
answer

select SQL fields after a certain date

I have a table that has daily records (test table) for 2 years I want to get the result from a certain generated by php date "$ last_periodo_date" $last_periodo_date = date("Y-m", strtotime("- 1 month"))."-25" ; $ last_periodo_date alw...
asked by 30.07.2018 / 17:59