Questions tagged as 'mysqli'

1
answer

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or 'identifier (T_STRING) or variable (T_VARIABLE) or

I can not figure out where the error is. I believe it is in the face, but I can not find it! $inserir = $conexao->query("INSERT INTO cadastro (nome, sobrenome, email, senha, contrata, trabalha, status) VALUE ( $_POST['nome'],...
asked by 23.07.2017 / 04:50
2
answers

Grouping a set of measures in PHP

I have a problem to join a set of values. I have a wood marking system. I feed the database with the length x width of the wood Id, order_id, length, width, date Registros: 1, 3, 320, 20, 05-25-2017 2, 3, 320, 25, 05-25-2017 3, 3, 310...
asked by 30.05.2017 / 22:18
1
answer

How to return the sum of values of a column with limit in MySQLi

When I run directly on the bank select sum(peso) from (select peso from dados order by id asc limit 2) as subt Returns the expected value. When I execute in PHP with the $num=2 variable, there is no value return or error....
asked by 11.07.2017 / 06:00
1
answer

Problem in return of PHP function [closed]

Good afternoon, guys I'm starting in php and I have a problem with my code function buscarIdProduto($conn,$nome){ $stmt = $conn->prepare("SELECT id FROM produto WHERE NOME_Produto = ?"); $stmt->bind_param("i", $nome); $stmt...
asked by 27.04.2017 / 18:52
1
answer

Problem when performing update

I have on the site the system to register, list and edit users. Registering and Listing are ok, however, when trying to update a record, it does not change in DB and also does not return any errors. I already checked the connection and...
asked by 27.04.2017 / 22:13
1
answer

SELECT always returns the last record

I'm trying to make the moment that I select an option in a select form, other fields are filled through this information. I've been able to do this partially, the last record in the table I'm looking for is always selected, but it actuall...
asked by 26.04.2017 / 21:29
3
answers

differentiate type of user with php [closed]

I have a system for registering my system that has two types of users: teacher and student. has a field in the form that is the "user type" of which can be teacher or student. I made a code, but it is very ugly and wanted to help me. It works, b...
asked by 06.06.2017 / 01:01
2
answers

Problem with mysql upgrade to mysqli [duplicate]

I'm trying to install a script from a website, but my knowledge of Php is poor, I installed the database and the files in FTP , but the following error appears:    Deprecated: mysql_connect (): The mysql extension is deprecated and wi...
asked by 22.05.2017 / 23:38
3
answers

Block access to PHP pages with SESSION

I'm practicing PHP. I'm setting up an admin panel with login screen. I have my index.php page which is the login (EMAIL AND PASSWORD). After logging in, go to admin.php page The detail is that if the user enters www.seusite.com.br/ad...
asked by 09.03.2017 / 18:46
1
answer

Can you improve these 12 selections where only one parameter changes?

I have an online table with about 3 thousand records. I make twelve selects to list the results per month, eg: select count(campo) from tabela where extract(year from data) = 2016 and extract(month from data) = 1; select count(campo) from tabe...
asked by 26.10.2016 / 19:16