Most voted "mysqli" questions
The Mysqli extension (Mysql Improved) is a relational database driver used in the PHP programming language to provide an interface with Mysql.
Learn more…945 questions
Sort by count of
-
2
votes2
answers103
viewsHow to search multiple data in mysql without losing performance
I have a table called "readings" where my search returns 10 thousand results for the equipmentid = 1 SELECT id, result, date FROM readings WHERE equipamentid = 1; for each returned result I need to…
-
2
votes1
answer35
viewsPull image from database
I’m creating a website recipes and wanted to show the image that the user entered when registering. In my database I made two tables, one from the recipe and the other for the image file. CREATE…
-
1
votes3
answers525
viewsDoubt with Mysqli and PHP OO
I have the following code snippet: public function registerUser($link, $nome, $sobrenome, $apelido) { $sql = "INSERT INTO estudo_oo (id, nome, sobrenome, apelido) VALUES ('', '$nome', '$sobrenome',…
-
1
votes1
answer204
viewsError Uploading File to Database
I’m trying to upload a file to the database. Only instead of him sending the file to you, he’s sending you his temporary location. My code is like this: $arquivo = $_FILES['arquivo']; $name =…
-
1
votes1
answer214
viewsFilter search does not work
I have a form that passes the query data and an external PHP file called busca.php My problem is that I don’t get any php error to know the problem of it not finding the filter search. When I use…
-
1
votes2
answers664
viewsPhone book with database
I have a phone book with the form already ready and now I need that when the user type in the field search a name or sector, this value should be compared with values of the database and be returned…
-
1
votes1
answer100
viewsSecurity information when entering data
Mysqli (Mysql Extended) has greater security and I thought so far that I did not need to process the variable data before adding to the bank, but studying on that page found this code similar to the…
-
1
votes2
answers9250
viewsHow to mount a select by taking information from the database
I’d like to ride a select with database information using Mysqli, whereas the value, will receive information from my cod_usuario and the information that will be displayed is the column nome.…
-
1
votes3
answers9511
viewsAsk before deleting database data
I have this code: <?php if ($result = $mysqli->query("SELECT * FROM usuario ORDER BY id")) { if ($result->num_rows > 0) { echo "<table border='1' cellpadding='5' cellspacing=0…
-
1
votes2
answers193
viewsError in saving dates
Following the line of Validate different date formats The function below has met my needs: function validateDate( $date ){ $europeu = date('Y-m-d', strtotime(current(explode(' ', trim($date)))));…
-
1
votes2
answers20410
viewsIssue with Discontinued Mysql for Mysqli
I’m having a problem on my site, it all started after I received a discontinuation message from Mysql, and asked me to change to Mysqli, after I change a series of codes appeared on my page, what I…
-
1
votes3
answers1239
viewsCode to display the login client data
Well my question is this, when logging in how I get session data? I think it’s a select, but when I do it I have to create a session? Because I want to search the data only of this client who logged…
-
1
votes3
answers2776
viewsSend POST Textarea one value per line
I have a form with a textarea where it will have a value per line. Example: I need to send this value to the Mysql database. Then on another page I need to create a For to list these values. What…
-
1
votes2
answers328
viewsCommit using PHP
Defining SET AUTOCOMMIT=0 on connection but not working. I’m using $mysqli->real_connect() if (!$conn->options(MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT=0')) { $fErro .= '<p>Não foi possível…
-
1
votes1
answer246
viewsHow to select smallest record by field
How can I present the smallest factor by ID_ACORDO? SELECT LIGACOES.ID ,ACORDO.ID_ACORDO ,ACORDO.DATA as 'DATA_ACORDO' ,LIGACOES.time_of_contact AS 'DATA_LIGACAO'…
-
1
votes0
answers149
views"Leak" by Session
Something strange happened while we were using the system on the NET. Well, every time a user logs into the system, I store his ID as follows: $_SESSION['usuario']['uid'] = $id_user; and direct you…
-
1
votes1
answer1827
viewsHow to create a set of tables in the database via PHP
I’m having problems while creating the database automatically via PHP. I am developing a college MVC project and wanted to import the sql file and through a query create the tables. In the previous…
-
1
votes1
answer41
viewsSQL - Select all records with encoding errors
Make a select in the database bringing all records with coding errors: SELECT * FROM tabela WHERE titulo LIKE '%ÇÃ%' Does anyone know another more efficient way?…
-
1
votes0
answers41
viewsFormat JOIN result object
[PROFESSORES] id | nome | 1 | Gilson | [CURSOS] id | nome | professor_id 1 | Photoshop | 1 2 | AutoCad | 1 I would like that in the result of my SELECT, the object comes in the format: (Not…
-
1
votes0
answers31
viewsCan we avoid Sqlinjection with mysqli_real_scape_string only?
Example: $conexao = mysqli_connect("localhost", "user", "password", "my_db"); $pegaNome = $_POST['nome']; function insere($conexao, $pegaNome) { $nome = mysqli_real_scape_string($conexao, $nome);…
-
1
votes1
answer405
viewsRequest jQuery Post + PHP + Mysql does not save data
I am making a registration via jQuery Ajax, so I created the following function: function salvarCadastro(titulo, form, caminho) { var dadosFormulario = $("#" + form).serialize(); var myData = $("#"…
-
1
votes1
answer349
viewsChange table in mysql
I have the following situation. A table that displays the searched results in mysql, and within this table I have a column where the edit button is. How do I get this button to edit the content…
-
1
votes1
answer88
viewsIn the index used in the query / prepared statement
I have a strange Warning in my code, when there is only one data in DB it recognizes and works well, but when I insert more than 1 data in DB it shows me the following Warning: No index used in…
-
1
votes2
answers3194
viewsCall to a Member Function fetch_assoc() on a non-object
I used Mysql and PHP on wampserver, now with the latest version it uses Mysqli I’m having problems with the following command: // Executa uma consulta que pega cinco notícias $sql = "SELECT * FROM…
-
1
votes1
answer1227
viewsMysqli Cannot pass Parameter 2 by Ference
Colleagues. I have the following code below: $conexao = new mysqli('127.0.0.1','root','','teste'); if(mysqli_connect_errno()) die(trigger_error(mysqli_connect_errno())); $cadastrar =…
-
1
votes2
answers159
viewsfetch_array does not return data
I am making a user list and the data does not appear on the page. I waited for the user’s name, his type and the number of posts and responses he sent to the system to appear. There is another…
-
1
votes1
answer4960
viewsPdostatement::execute() error: SQLSTATE[HY093]: Invalid Parameter number
I have the following code, I used another similar to do a database update, but this now does not work; it gives the following error: Warning: Pdostatement::execute(): SQLSTATE[HY093]: Invalid…
-
1
votes0
answers140
viewsSearch filtering Yii Start and End Date
How you do a Start Date and End Date search. I’m using the Yii Framework. Can someone help me? I’m not getting the date right.…
-
1
votes2
answers525
viewsTurn Sequence of Numbers into Data with PHP and SQL
I have a database that has a numerical sequence recorded in a table that means a publication date of an article. I wonder if someone can decipher this numerical sequence so I can print the correct…
-
1
votes1
answer120
viewsUpdate error "Call to Undefined Function mysqli_sql()"
When performing the update is returned me the following error in the first result: Error: Fatal error: Call to Undefined Function mysqli_sql() in F: XAMPP htdocs PAPBRUNO PAPBRUNO…
-
1
votes0
answers110
viewsMultiple queries with a single connection
I’m making a site where on the same page I need to make several queries, in mysqli. when I run the site in xampp runs perfect. but not on the web server. Only comes the first consultation and not…
-
1
votes1
answer202
viewsHow to create multiple tables at once?
I wonder how I can make this code below run the creation of several tables with mysqli_ at the same time because at the moment this code being executed only creates a single precise table that it…
-
1
votes2
answers94
viewsHow to adapt code to mysql_
Ola would like to know how I can adapt the code below to mysqli necessarily the excerpt below. Section to be modified to mysqli $filmes_generos = array_map('mysql_real_escape_string',…
-
1
votes0
answers675
viewsMysql Error 2002: Can’t connect to local Mysql server through socket
I’m just putting a website for hosting and already set up the connections mysqli, but it’s giving this error here when trying to run the site: Warning: mysqli::mysqli(): (HY000/2002): Can’t connect…
-
1
votes1
answer189
viewsHow to put db_connect with my_sqli
My code: <?php class DB_CONNECT { // constructor function __construct() { // connecting to database $this->connect(); } // destructor function __destruct() { // closing db connection…
-
1
votes2
answers612
viewsDoubt about white spaces within PHP code
I’m making the connection with prepared statments to insert many variables, and in some cases it takes me a long time to find the mistakes, and now I put in one here and hit me a question: White…
-
1
votes0
answers517
viewsI cannot write tinyCME formatted text to the database
The code without the text editor saves to the database. After I placed the editor, the form’s Submit button does not send data. I’m also interested in recording excerpts of programming codes. Below…
-
1
votes2
answers1980
viewsHow to group results from a row query to columns
Good afternoon, have this query SELECT tblcliente.idCliente, tblclienterespostapre.resposta FROM tblcliente INNER JOIN tblclienterespostapre ON tblclienterespostapre.idCliente = tblcliente.idCliente…
-
1
votes1
answer636
viewsbind_param() dynamic
I have the following class: class BindParam{ private $values = array(), $types = ''; public function add( $type, &$value ){ $this->values[] = $value; $this->types .= $type; } public…
-
1
votes2
answers341
viewsEdit selected record
I show records coming from the database in td’s, in each record there is an edit button that opens the edit screen, however I do not know how to display on this screen the data of the registry I…
-
1
votes0
answers825
viewsHow to take data from different tables and insert into a new
Good evening, I’m doing a job for a course subject and in it I have to work with three tables, in my case I use a table customer registration, a second table car registration and the third would be…
-
1
votes0
answers31
viewsFrequency System | Convert to PDO or MYSQLI
Do you have how to convert these mysql codes to PDO or MYSQLI, Please Help Me :( <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"…
-
1
votes2
answers3740
viewshow can I use group by next to order by
how to use the GROUP BY along with the ORDER BY? need to order my tabela so ASC but I can’t use GROUP BY how should I use the two together? code snippet: mysqli_query($conn, "SELECT nome_fotos, img,…
-
1
votes1
answer93
viewsLine Chart being populated only with last record only in while/php
Code: <!doctype html> <html> <head> <title>Line Chart</title> <script src="dist/Chart.bundle.js"></script> <script src="utils.js"></script>…
-
1
votes1
answer1289
viewsWarning: mysqli_query() expects Parameter 1 to be mysqli, integer Given
I have this code below: <?php $conecta_no_banco = require_once ('conecta_db.php'); $login = $_POST['login']; $senha = $_POST['senha']; $sql = mysqli_query($conecta_no_banco,"SELECT usuario FROM…
-
1
votes1
answer689
viewsError "Call to Undefined method mysqli_stmt::get_result" and "Class 'mysqli' not found"
I am developing a simple API using the Slim Framework. When I perform local tests all functions work the way they should but I started having problems when I went up to a certain hosting. It happens…
-
1
votes0
answers168
viewsUpdate using Json HTML and PHP
Good morning I need to update the data on my index They are loaded as follows Javascript $("document").ready(function () { function gerarFunctionario(obj) { return '<div class="col-md-4 col-sm-4…
-
1
votes1
answer57
viewsPurchase of PHP image editing and information coming with POST
My code is not editing the information the way it is with the following error, Unknown column '$full name' in 'field list', and I am passing this value and all the others.. The Editing Form:…
-
1
votes0
answers53
viewsHow to add variable in query as column?
How do I add the variable $pesq as column of a query ( not query) query? $pesq = mysqli_real_escape_string($dbcon , $_POST['pesq']); $pesquisa = mysqli_real_escape_string($dbcon ,…
-
1
votes1
answer464
viewsDoes anyone know how to fix a website hosting error?
someone knows how to fix an error in the $stmt = mysqli_prepare($mysqli, $sql); mysqli_stmt_bind_param($stmt, 'i', $id); mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); it does…