Questions tagged as 'mysql'

1
answer

Import, analyze and extract data from a CSV with PHP [closed]

How can I do to import a csv file with PHP and grab the data from a specific column and write that data to the database? Can you do this analysis and save only specific data (type a column, or row)?     
asked by 17.03.2016 / 14:48
1
answer

Roundup of 5 in 5 cents

In a PHP system I'm developing, I need to update a column of the price table. The price field is in float format and the administrator informs the percentage of increase. Example: Reports that it will have a 10% increase. $valor_anti...
asked by 27.02.2016 / 16:17
2
answers

How to correctly save an image URL in MySQL database?

I'm testing the targeting of images with the URL. But during the tests, the URL was returned with changes as seen below: URL entered in the database: http://www.meusite.com.br/pastaimagem/logos/imageLogo.jpg URL returned by the bank: h...
asked by 23.02.2015 / 21:33
1
answer

How to convert a date to this format in PHP?

Can anyone tell me what kind of date is this format? 2013-09-17T05:59:00+01:00 I have in the database a field of type timestamp or date. How to convert the value of it to this format using PHP?     
asked by 22.04.2015 / 16:55
2
answers

How to insert multiple arrays into a MySQL table

I get via Ajax a $_POST request with 5 indexes and the last 3 are Arrays. It looks something like this: Array ( [c] => [s] => [dt] => [nl] => Array ( [0] => valor1 [...
asked by 07.04.2014 / 02:51
1
answer

Combination of 4 numbers in MySQL

DBMS: MySql Problem: List all the possibilities of combinations between the numbers "1,2,3,4", so that they do not repeat between them. Example: 1 2 3 4 12 13 14 21 23 24 31 32 34 41 42 43...     
asked by 22.04.2014 / 21:02
3
answers

GROUP BY last record

I'm doing a query in the database, follow my table below id | protocolo | status | alteracao | datahora 1 2 1 teste 2014-11-10 15:23:44 2 2 3 teste 2014-11-10 14:23:44 3 2 4...
asked by 10.11.2014 / 18:47
4
answers

Sign of different Query

I have a problem submitting Query. I have the alvaraValidade field that only receives Date fields. When I do not put anything in this field, the date field is saved as 0000-00-00 . $sql = "Select * From tb_trabalhador wh...
asked by 25.02.2014 / 13:38
1
answer

How to select categories and count number of products of each category?

I'm trying to select the categories of the database and count in the same query the number of products registered in that category. So far so good, the problem is that I can not return the category when there is no product registered, for exampl...
asked by 05.05.2014 / 22:09
2
answers

How do I make mysql_num_rows of multiple results

Well, what I want is the following: I have 1 table designated by items, in this table I have 4 columns: name iditem (Unique ID) numerobot What I want to do is: I want to make a mysql_num_rows of all results, but for each different...
asked by 15.02.2017 / 01:12