Questions tagged as 'mysql'

2
answers

Get highest and lowest id with status = 1

I have a table in the multi-line database, I wanted to get the highest id, which has status = 1, how can I do this with php? The id is one column of the table and the status is another. Then I also want to know how to get the least elevate...
asked by 06.03.2016 / 14:46
1
answer

SELECT INSERT within PHP Mysql INSERT

I have the following code: $sql = mysql_query("INSERT INTO TB004_PRODUTO_FORNECEDOR ( TB002_CODIGO, TB003_CODIGO ) SELECT TB003_CODIGO, 1 AS Codigo FROM TB003_PRODUTO WHERE TB003_DESCRICAO = '$name_02'...
asked by 15.11.2016 / 19:20
2
answers

Save Date to UTC Table Brazil

I'm doing an insert into a MySql table that contains multiple date fields. I left the current_timestamp value in the created_at column of the table. If I do an INSERT now, it's inserting: 12:29:00. That is, three more hours. And i...
asked by 01.07.2016 / 14:30
2
answers

IF condition between PHP MySQL tables

OPa, I have two tables: forma_pagamento and forma_pagamento_selecionada . I have a while where all forms of payment should be listed, so in this while you must have a IF condition where a new column will return me, in c...
asked by 28.06.2016 / 05:21
2
answers

Getting MySQL image

I'm making a website in PHP and MySQL to store products and image them. On the products page there are 5 or more models and I need to get 5 or more images of each product. I do not know if I create another table and put the images...
asked by 24.06.2016 / 04:01
1
answer

Post Post Wordpress

I have the following script that returns me the status and the amount of posts it has in this state, now I would like to view these posts, does anyone know of any solutions? <?php $query=" SELECT e.id ID,e.uf UF, e.nome Es...
asked by 06.10.2015 / 15:17
2
answers

How to treat accented and uncharged strings in LIKE too

I'm doing a query where I need to fetch the data based on the first letter of a string, for example. Accessories; select * from tabela where column LIKE 'a%' But if I pass some letter that has accent registered in the bd I can not...
asked by 03.08.2016 / 15:24
1
answer

While returning duplicate data

Good morning guys, I have this query $query = "SELECT p.*, c.nomeCategoria AS categoria FROM produto AS p INNER JOIN produto_categoria AS c"; $dados = mysqli_query($con, $query) or die(mysqli_error()); and a while that returns the value in...
asked by 24.07.2016 / 17:21
1
answer

system with 2 databases, returning empty queries mysql php

I have a system where I have the user base that is a unified database in one database, and another system based on the system. In my pages I call them like this: <?php include("conn_user.php"); include("conn_sys.php"); ?> Here are the...
asked by 02.08.2016 / 20:38
2
answers

Input name with dynamic name

I want to create a form with a variable number of inputs, according to the amount of data coming from a DB and assign them to the "name" unique names. Then I need to submit this form and retrieve the data via POST. I thought I'd do somethi...
asked by 03.11.2015 / 03:13