Questions tagged as 'mysql'

0
answers

MySQL Query works in Workbench but not in php script

I did a search on this problem, I found several with similar situation and, nevertheless, the problems were others. I have the following code where the query, if it is executed in the console, MySQL Workbench or phpmyadmin works perfectly. In th...
asked by 23.08.2016 / 19:33
0
answers

Sort by value outside MySql query

I need to sort the result of my search by a value that is outside the query.    For example, in the query I have a field called response and with this   value I make a calculation. But the result of this calculation is not in   table. My...
asked by 08.08.2016 / 14:58
1
answer

How do I mount pair of array key vaue to insert into table?

$key = "id,name"; $val = "'$lastid','$autor'"; ... if ($email){ $key .= ",email"; $val .= ",'$email'"; } ... $keys = \explode(',', $key); $vals = \explode(',', $val); $arr = array_combine($keys,array_fill(0,count($keys),$vals)); .... //O a...
asked by 10.09.2016 / 01:02
1
answer

PHP and MySQL image array upload

I have the following code: <?php if(isset($_FILES['files'])){ $errors = array(); foreach ($_FILES['files']['tmp_name'] as $key => $tmp_name){ $file_name = $key.$_FILES['files']['name'][$key]; $file_size = $_FIL...
asked by 09.09.2016 / 15:05
2
answers

MySQL error "expects parameter 1 to be resource, boolean given in"

$query = "Select * from servico where ID_SERVICO = $id"; $result = mysql_query($query); if($row = mysql_fetch_array($result)) { $nome = $row['NOME']; if($nome == 'Marketing') { include ("servicos/marketing.php"); }...
asked by 07.08.2014 / 19:13
0
answers

I created a db with Wamp but when I click on the folder to see my php files n nothing appears

In phpmyadmin the db is ok, but when I click on the folder that has the phps appears: Can not access this site Could not find the DNS address of the folderName server. My wamp is green and working, and the phps are inside the folder right...
asked by 10.09.2016 / 17:27
1
answer

How to create aTrigger After Update

I need to create a Trigger that performs an update on column A of table T, as soon as column B of this table is updated. So I believe I need to create an After Update. But from what I understand, it is not possible. When you try to do this, the...
asked by 03.08.2016 / 21:12
1
answer

SAT CFe Fiscal Database

I am developing a WEB application in PHP, does anyone who has made a SAT system inform me if it is necessary for the user to have the SAT database, or a copy of it, on the local computer? or can I keep a MySQL database on a server with no fiscal...
asked by 04.08.2016 / 21:47
1
answer

Doubt to build MySQL query

On my system I have the following tables: tb_partida(id, data_hora, flag_ativo, tb_cotacao_id, tb_campeonato_id) , tb_campeonato(id, nome_camp, tb_pais_id) e **tb_pais**(id, nome_pais, tb_continente_id) . Well, I need a select...
asked by 01.08.2016 / 20:40
0
answers

exceeded the 'max_user_connections' resource (current value: 3)

Good evening guys. Dude, I hate this mistake and I have no idea how to fix it. I'm closing the connection to the bank after each request, but it still goes on. I'm using PHP. Does anyone know how to fix this? exceeded the 'max_user_...
asked by 20.07.2016 / 03:29