Questions tagged as 'mysql'

3
answers

SQL ordering only after the third character

I have a field in my MySQL table that is of type string, with the following data: Coluna 01DV 03DV 04DV If you enter the value 02CA the farm field thus Coluna 01DV 02CA 03DV 04DV I need it to look like this: Coluna 02CA 01DV 0...
asked by 03.07.2014 / 01:28
1
answer

How to limit the number of pages displayed on a page?

With this question that already has a workaround, I got as a result a paginação com PDO but I have one more problem that will possibly be the target of a reward next week. As you can see in the image below, I have this page with +...
asked by 03.10.2014 / 22:03
3
answers

How to deal with multiple queries?

I have a question regarding good programming practice. How to handle multiple queries on a single page in PHP. For example, the code: $qr = "SELECT historico.*, funcionarios.nome FROM historico INNER JOIN funcionarios ON (historico.funcion...
asked by 20.05.2014 / 04:59
2
answers

How do I return the ID of a record right after it is entered?

I'm doing a Java application in conjunction with a MySQL database and would like to know what would be the best command to return an auto increment ID of the database shortly after the registry was entered. My application will work with multi...
asked by 24.05.2015 / 23:20
4
answers

Convert Field Data Date to Month Mysql

In a DB table I have a Data Field (0000-00-00) and I need to do the following: Create a field next to 'Month' that takes the date Ex: 2014-08-27 and pass the 'August' value to the month field. And so on with all the records in the Data field. Ho...
asked by 27.08.2014 / 14:12
1
answer

A product in Various Categories - PHP

Would you like to know how to link a product into several categories? For example: A shirt may be in the "Green / Blue / Yellow" categories and when I filter by category the product should appear in the "Green, Blue or Yellow" category. I kno...
asked by 30.03.2015 / 20:51
2
answers

How to search for two words in the same field Mysql

Good morning. I have a field in my table called tags , I would like to search, where two or three words can be considered. Example: In the tags field, I have some words, like "free", "booths", "audiometer" ... with the query b...
asked by 09.03.2018 / 15:12
2
answers

Always present an error when I try to use the mysqli expression

I know that the expression mysql has been deprecated, so I'm trying to use the expression mysqli , but every time I try it shows me a syntax error! example: $buscaDados = mysqli_query("SELECT * FROM usuario"); Generate this er...
asked by 04.03.2014 / 23:13
2
answers

Query MySQL in PHP only works locally

It's as follows: the system I'm servicing was using two query types (do not ask me why) and locally (localhost) work perfectly. When I uploaded the project to the server, the queries declared like this: <?php $sql = mysql_query("INSERT INTO...
asked by 11.02.2014 / 18:21
1
answer

Concatenate columns in rows

I'm trying to grab multiple columns and turn them into single line, but to no avail. This is the select I'm trying to do: SELECT ('dias2produto'+'dias4produto') as 'Até 4 dias', round(((('dias2produto'+'dias4produto')*100)/'total_produto'),...
asked by 22.08.2018 / 17:12