Questions tagged as 'mysql'

1
answer

Convert a variable to STRING in the mysql query in PHP

In the query below within my PHP the variable $ line [0] is not validating as a string, however if I give a var_dump ($ line [0]); before arriving at this query, it shows that it is a string! $result = $conn->query("SELECT player, ip from g...
asked by 02.03.2016 / 21:03
1
answer

Problem starting mysql in xampp

I tried to use xampp but every time I try to start mysql it issues the following error: Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MYSQL57"! H...
asked by 31.01.2017 / 01:33
1
answer

List all data with the same id

I have the following problem: I have a table named pedido . In this table I get data from two other tables: I'dliketomakealistofonlyproductsthathavethesameid_venda.Inmycodeonlythefirstitemaddedwithequalidappears:<?php$perfil1=mysql_...
asked by 28.12.2015 / 20:38
2
answers

How to use sprintf to mount a SQL query? [closed]

What is the correct way to use sprintf in mysqli and make the return IF? $rs = $mysqli->query(sprintf("INSERT INTO perguntas (chave, nome, email, idade, estado_civil, profissao, religiao, assunto, pergunta, 'data') VALUES (%s, %s, %s...
asked by 04.01.2016 / 13:06
1
answer

Time difference in execution of the same query between PHP and PHPMYADMIN

I'm trying to improve the performance of my pages to improve the user experience, but I'm not able to identify the problem. According to Google, it is recommended that pages respond in less than 0.4 seconds, but only the connection to the dat...
asked by 19.07.2016 / 15:27
2
answers

Write Several Numbers In A Field In The Database

I have a column in a table in the database that is called "synchronize" inside it I want to save several numbers separated by commas, and then do a check on a page as follows, that if there exists between those commas a number that is equal to t...
asked by 26.04.2016 / 07:45
2
answers

INSERT CONCATENATE PHP MYSQL

I want to insert a record in mysql, according to the id already has something predefined example I will insert a post with the category with id = 2, so the name of my post will be something that I have already defined the rest of the past...
asked by 18.07.2016 / 05:57
1
answer

Problem with WHERE and BETWEEN between two MySQL tables

I'm doing a select based on a filter that I get from a form, but it falls into a problem I do not know how to solve. I have two tables, the user table and the user_aula table. I need to count the total classes that the user gave and then do a...
asked by 29.04.2016 / 17:29
2
answers

Make multiple inserts in SQL, multiple inserts

Good night to all, once again live my Achilles heel with the blessed sql ... I want to insert data into two tables ... client table and address. I get the sql below, fill in the variables and execute the sql in phpmyadmin and it works ......
asked by 20.05.2015 / 00:03
1
answer

SELECT SUM MYSQL

I have the following MYSQL query: select v.id,valor_sap,month(dthr_operacao) as mes, fornecedor_nome from viagem v INNER JOIN agente_viagem av ON v.id = av.viagem_id INNER JOIN agente ON av.agente_id = agente.agente_id INNE...
asked by 12.06.2015 / 03:54