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
votes0
answers74
viewsWhat is the difference between PDO and Mysqli_?
I have been densevolving applications in PHP Mysql for a long time, and for norlamente I use the object PDO to connect with the base de dados and everything works perfectly. But today I decided to…
-
2
votes2
answers1898
viewsMessage to user after header change
I have a small problem with PHP, I need to redirect the user, but I wanted to notify you of what happened, I redirect you with the header(), but if I try to send something before the header failure,…
-
2
votes1
answer139
viewsSort results with month and year
I have a table with the fields mes E ano. How can I sort the results according to the month. I’m already ordering according to the year => SELECT * FROM tabela WHERE id_cliente = '$id_cliente'…
-
2
votes1
answer835
viewsHow to pass dynamic variables from a url to php via ajax
First of all I have looked in several other posts on the subject here and I did not find what I need, my scenario is the following I am generating several EX links: challenge.php? id=2&name=Joao…
-
2
votes3
answers497
viewsError Search PHP and Mysql Database
I’m making a page that searches for information in tables of a Mysql database, the connection is beautiful, but is showing two errors : Warning: mysqli_stmt::bind_param(): Number of variables…
-
2
votes2
answers644
viewsError in select with PHP + Mysqli
I’m trying to use a query to pull one ID specific that comes from another page. I can receive the ID for $_GET, i printed the query to see if it was right, even so of the error and does not show me…
-
2
votes1
answer46
viewsHow to print the selected database ID?
Is there a function to take information from a specific ID of my database and print with domf? My code: $id = "30"; $result_usuario = "SELECT * FROM cadastro WHERE id = '$id' LIMIT 1";…
-
2
votes1
answer442
viewsUpdate table field only marked with php mysql checkbox
@Leo Caracciolo worked out the way you did in this post here, but I have another problem: there are students who are enrolled in several courses, ie the student id is the same , but the course id in…
-
2
votes1
answer398
viewsmysqli_query returns false to select done with REGEXP
I am having the following problem: I am trying to capture a table row of my database using a regex and, when entering the code in the Mysql terminal, it captures the line normally. Already in my php…
-
2
votes0
answers44
viewsSwitching from MYSQL to MYSQLI
PHP Deprecated: mysql_connect(): The mysql Extension is deprecated and will be Removed in the Future: use mysqli or PDO Instead in /resocubatao/public_html/includes/Bancodedados.php on line 6 on my…
-
2
votes2
answers115
viewsConverting two Mysql selects to one
I have a little doubt about Mysql. I have the following Mysql query: sq1 = mysqli($conexao,"select * from tabela1"); $tr1 = mysqli_num_rows($sq1); Then I make the famous bow: for…
-
2
votes1
answer623
viewsmysqli_query() does not return false
Starting in PHP, I recently learned OO with PHP and had a little problem when converting my procedural code to OO. I have an "orgao" table (columns: id, org_name) with only 1 record. I query through…
-
2
votes2
answers1429
viewsProblems with mysqli_result as array
I’m trying to make the page display the documents sent by the user, but always returns me the same error Fatal error: Cannot use Object of type mysqli_result as array in >C: wamp64 www…
-
2
votes3
answers140
viewsGROUP BY last registration per month and year how to do?
I’m making an appointment at the bank, follow my table below id | valor | mes | ano | 1 39.69 3 2017 1 7.69 3 2018 3 9.69 4 2015 3 3.69 2 2016 2 5.89 3 2017 2 39.69 8 2018 need to bring the result…
-
2
votes1
answer1414
viewsFilter php mysql table by date
I have a table on a php page that displays customers who have sent leads to the site. There is how I create an input in which the user puts a date and only appears the leads sent on this date?…
-
2
votes1
answer59
viewsDoubt about SQL Injection/mysqli_real_escape_string
I’m having doubts about SQL Injection in PHP. I have a class that has the user object, and there has name, age, etc. Then I put in the variable query something like: insert into…
-
2
votes1
answer189
viewsHow to take the value of an sql record and store in PHP variable
I have an sql table as follows: usuario (`matricula` varchar(20) not null primary key, `nome` varchar(45) NOT NULL, `senha` varchar(15) NOT NULL); In php I’m trying to get the name of a user who has…
-
2
votes1
answer107
viewsRollback method does not work in mysqli extended class
Hello, Because of the PHP version on the server, the fetch all and begin_transaction methods of mysqli do not work. To solve this, I created another connection class extending the Mysqli class and…
-
2
votes1
answer79
viewsQuerys have stopped working
I recently made a change to the table and after that SELECT and INSERT INTO stopped working. At first the INSERT INTO could not include data in the last column that includes (centid), returned…
-
2
votes1
answer615
viewsWarning error: mysqli_fetch_array() and no error returned in mysqli_error
I have a simple mistake and I can not find a solution, it seems to me that my problem is different from this answer here. The error message is this: Warning: mysqli_fetch_array() expects parameter 1…
-
2
votes2
answers1275
viewsExplanation of login and profile validation code
I’m learning php however (I don’t know if it’s the custom of a beginner) the code is getting messy as I try new things. I took some lessons on youtube channel Celke however despite being very…
-
2
votes1
answer51
viewsProblems with database query (Search system)
I’m trying to create a search system in db however this returning only one result, the last address in the table (I had managed to make them all return, however after changing the layout I went to…
-
2
votes1
answer369
views"mysqli_connect" does not work
I am unable to use the "mysqli_connect" function. Can anyone help me? You are returning the following error: Fatal error: Constant Expression contains invalid Operations in…
-
2
votes3
answers175
viewsINSERT with prepare does not work
I am trying to insert data into the database using mysqli prepare more are not inserting the data, and shows no error whatsoever Questions::: What am I doing wrong in this code below? That’s the…
-
2
votes1
answer752
viewsperform sum of values codeiginiter
I need to add some values at the end of a table as shown below: below follows the codes I am using: Controller: function index() { $this->template->set('title', 'Lista de Orçamentos'); $config…
-
2
votes1
answer899
viewsCreating event in Mysql
I would like to create an event based on 2 situations. I have a table and a column situat_id with values [1 - free], [2 - busy], [3 - Unavailable]; And another modified column - generates the…
-
2
votes1
answer276
viewsMulti upload with various php and mysql formats
I would like to do a multi upload with various img formats, I am researching how it does using php 7.1, I understood more or less the logic of the business. I just can’t seem to reproduce. Someone…
-
2
votes1
answer597
viewsButton Delete a line in DB
I’m having trouble with a little code with delete button. I’ve tried a few ways but I couldn’t get the button to $deletar do the delete function. Follows code show each registered slide and wanted…
-
2
votes1
answer518
viewsSELECT ... WHERE name LIKE bind_param
I have the following code: <?php $link = new mysqli("localhost", "root", "minhasenha", "meu_db"); $produto = $_GET['q']; $produto = '%'.$produto.'%'; $busca_produtos = $link->prepare("SELECT…
-
2
votes2
answers93
viewsError fetching database data
When I try to do a BD search for a login, it returns the following error: Recoverable fatal error: Object of class mysqli_result could not be converted to string in C: xampp htdocs TCC index.php on…
-
2
votes1
answer1026
viewsCall to a Member Function bind_param()
I’m a beginner in PHP and I’m getting this error while trying to make a Insert in the database using Mysqli functions: Fatal error: Call to a member function bind_param() on string in…
-
2
votes2
answers3764
viewsmysqli_select_db() expects Parameter 1 to be mysqli, string Given
I have a problem here with Mysql, is giving errors, I’ve made all kinds of changes. I’ve tried to change the Mysql function to Mysqli and only increase errors. Code: <?php $sql["host"] =…
-
2
votes0
answers33
viewsPDO class, how to prepare really avoids SQL Injection s
underlined textHello, I am studying PHP and, regarding POO together with PDO, I have the following question: I always see in the articles in this regard, that making use of the PDO statement:prepare…
-
2
votes1
answer367
viewsUpdate only records marked with checkbox at once php
I have a select that carries a series of records. Behold, in these records I need to apply an up and that, in my head, the best way would be using a checkbox field, so that when the user checked the…
-
2
votes0
answers28
viewshow to properly use mysqli->prepare and bind_param
how can I use the mysqli->prepare with the bind_param I am trying to log in using these two functions but I can think of the following error Only variables should be passed by reference…
-
2
votes1
answer218
viewsInsert Mysql syntax error
I can’t resolve the error below: Notice: Undefined index: Html_cor_task in C: Users User Desktop pi Fe Order2 Cadastrataefa.php on line 14 You have an error in your SQL syntax; check the manual that…
-
2
votes3
answers1555
viewsPHP - Error when trying to log in - mysqli_num_rows() expects Parameter 1 to be mysqli_result
Good afternoon guys, I was trying to study a registration system using Session in php the part of the registration works normal, the problem is time to log in, even with the correct password I get…
-
2
votes2
answers45
viewsWhile is not loading the logs
I am trying to repeat a region however, although mysqli_num_rows indicates that there are 9 records, while nothing is coming. My code is like this: $qry = "SELECT pe_orclinhas.id_orclinha,…
-
2
votes0
answers73
viewsHow to feed highcharts with myqsl data?
Guys I’m trying to create a chart using Mysql and Highcharts, but I’m having difficulties, I need to replace the Morris by the bar chart highcharts, follow php code ; function…
-
2
votes1
answer218
viewsAvoid Duplicity in PHP+Mysqli Registration
good night! How do I prevent registration with the same information? Currently my "processa.php" is like this, and I wanted to include the function mentioned above... <?php session_start();…
-
2
votes0
answers64
viewsProblem searching for the most recent result of a group in a query in two tables with PHP and Mysqli
I am studying mysqli and PHP to migrate a personal blog, from PHP 5.6 to 7 (mysql to mysqli), the blog has a table with names and other with items related to names, dates and times, below I will…
-
2
votes1
answer84
viewsSum of values of a bd column between a time interval - PHP
include "conexao.inc"; $sql="SELECT * FROM tb_abastece WHERE data BETWEEN ('20/01/2019') AND ('30/01/2019')"; $res=mysqli_query($conexao,$sql); while($vreg=mysqli_fetch_array($res)) { $id=$vreg[0];…
-
2
votes1
answer185
viewsPIVOT query in Mysql
I have a query in SQL Server using PIVOT that returns the data in column as image below: The query is this: SELECT * FROM( SELECT ftd.DateAndTime AS dt, ftd.Val AS Val, CONVERT(VARCHAR,…
-
2
votes1
answer213
viewsColumnchart not reverting colors of options google Charts
I am filling a Columnchart with the data brought from mysql, only that I would like to put the columns of different colors, more unsuccessfully. Shows the same color in both columns, as you can see…
-
2
votes1
answer84
viewsConnect time counter with the datetime of the database
Guys I’m with this script but I can not connect to the database at all, please help me?? is working perfectly this way, more precise pull the date from the database. Is returning these errors: Fatal…
-
2
votes1
answer135
viewsMore elaborate queries in Mysql
I have a problem in my application have the following tables Responsavel: id | responsavel_email 1 | joã[email protected] 2 | [email protected] 3 | [email protected] 4 | [email protected] Aluno: id | nome_aluno…
-
2
votes2
answers598
viewsRemove QUOTES when generating TXT file using PHP
How to remove "double quotes" in TXT file extracted from mysqli with PHP. PHP function to create file // Export data in CSV format public function exportCSV(){ $id = $this->input->get("id");…
-
2
votes1
answer119
viewsNews system with image upload in PHP - when there is no image!
I’m setting up a news system and in the Adm panel for registration today, the code works as follows: Register the title/text/image/ and make it active/inactive in the situation: In this case the…
-
2
votes1
answer72
viewsHow to make a select taking into account if the record exists, if it does not exist return null or empty
I have a code that returns the activities that have been completed within a 12 month period. SELECT empresas, tipo_atividade, CASE WHEN (SUM(CASE WHEN MONTH(dt_vencimento) = 1 THEN 1 ELSE 0 END))…
-
2
votes5
answers79
viewsSQL using two tables
I need to select all records from the table solicitation where all the table records tasks that have in the column id_solicitation the id concerning that request, and date of completion are…