Questions tagged as 'mysqli'

2
answers

Fatal error: Call to a member function fetch_array () on boolean when querying function help [duplicate]

I am doing a function that when it receives a number, in the case, an id it makes a query and it rescues the name that is in that id and I come across this error. code function catporid($cat){ global $aCon; $sql = 'SELECT cat_no...
asked by 14.04.2017 / 19:55
2
answers

How to retrieve 'mysqli-insert_id' from within this function, in addition to the query return?

public function executar($sql){ $con = new conexao(); $con->abrir(); $re = $con->mysqli->query($sql); // Preciso retornar esta informação tambem: $last_id = $con->mysqli->insert_id; $con->fechar();...
asked by 01.02.2017 / 12:15
1
answer

Error returning bank statement in MySQLi

Well, I'm doing a login system in PDO I do not understand much, but I'm going through this problem, I developed the following code below: $select = $con -> prepare("SELECT * FROM conta WHERE conta = ? AND senha = ?"); $select ->...
asked by 23.02.2017 / 03:15
1
answer

Problem with php code to send simultaneous messages to the database!

I am trying to create a code to send messages between the users of a system in php, the problem and that I can send the message from one user to another but I would like it to be possible to send to all users, one, the same message without havin...
asked by 22.02.2017 / 15:35
2
answers

How to use sprintf to create a query with date_format ()

I'm reformulating a client system and it is using procedural mode in login and not PDO, but to give more security, I used sprintf , but it is not working. See: $sql = sprintf( "SELECT *, DATE_FORMAT(DataAcesso,'%d/%m/%Y') AS DataDeAc...
asked by 20.03.2017 / 23:53
1
answer

Insert multiple data into a mysql column

Good afternoon, I'm breaking my head about how I do this insertion in the bank, it's something like this ... I have a product, which needs to be priced from more than one vendor, to compare prices. But my quantity of supplier depends on the q...
asked by 22.01.2017 / 18:16
1
answer

Undefined index: stream

I'm studying php and I can not understand the reason for this error. It runs the code as it should to some extent. Basically I am trying to use a database where users will enter the twitch nicks (everything working ok so far) and from that datab...
asked by 08.11.2016 / 21:13
1
answer

CREATE EVENT; syntax error only within mysqli_query ()

I'm trying to run an event command on mysql , while developing the query on the mysql workbench , it worked normally, but when I use it inside the mysqli_query of php is displayed the following error:    You have an error in your SQL...
asked by 18.08.2016 / 16:28
1
answer

using MySQLi within CLASS [closed]

Hello, I have a problem, I have some queries to do, I wanted to leave it inside class, I am doing the following code: <?php class MySQL { private $user; private $password; private $database; private $host; public functi...
asked by 11.08.2016 / 20:12
1
answer

How to list mysqli data displaying in DESC but listing from top to bottom? [closed]

I'll try to explain it better, like this, when listing something from the database with DESC id it shows something like this: id:1 id:2 id:3 id:4 id:5 But I want it to look like this: id:5 id:4 id:3 id:2 id:1 In this case using ORDER B...
asked by 02.08.2016 / 04:23