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
-
-1
votes1
answer638
views -
-1
votes1
answer545
viewsPick up specific fetchAll item in PHP
I’m using the code: $lista = $db->query('select * from tabela') or trigger_error($db->error); $lista->execute(); $item = $lista->fetchAll(PDO::FETCH_ASSOC); $mes = 1; while ($mes <…
-
-1
votes1
answer12297
viewsPHP Warning Code Error: mysqli_select_db() expects Exactly 2 Parameters, 1 Given
The error of my code is in the Connection to the database, is the following: mysqli_select_db() expects Exactly 2 Parameters, 1 Given <?php $servidor='localhost'; $banco='isartes';…
-
-1
votes1
answer559
viewsError 403 - Password validation forbidden access with Mysql in PHP7 code, how to fix?
Good afternoon guys, I am taking a course of a real estate portal system in PHP that I bought and I I stopped at the time to make the portal login system. The course uses PHP below version 5 and the…
-
-1
votes2
answers175
viewslogin system using php and mysql
I’ve made some changes to the program, but it’s still giving me the slip...: mysqli_query() expects at least 2 Parameters, 1 Given. <?php $username="username"; $pwd="pwd"; include…
-
-1
votes1
answer38
viewsI can’t find the error of this Stored Procedure
delimiter $$ create procedure reposta(out mensagem varchar(100)) begin if new.codigo_veiculo != null then set mensagem = "Algum veículo está sendo utilizado"; end $$ delimiter ; error that appears…
-
-1
votes3
answers810
viewsAvoid multiple PHP Notice: Undefined index: inside a loop for
The variable $words concatenates the result of a query into a column of a table where words are separated by comma. Only that when running the script for each word inside the for is is generated a…
-
-1
votes1
answer53
viewsError in my query ifnull. why?
Query that this marked red does not work and blue works! SELECT * FROM posts LEFT JOIN (SELECT COUNT(id_rela_post), ifnull(qt_vezes, 0), para FROM rela_post GROUP BY para) post_detalhe on…
-
-1
votes2
answers104
viewsMysql connection error
I’m using this code: <php? $sql = mysql_query("SELECT `id`, `detail`, `time` FROM `news` ORDER BY `time` DESC LIMIT 5"); $return = mysql_fetch_assoc($sql); while($row = $return) { ?> Data:…
-
-1
votes2
answers79
viewsWhen giving the result of a query, this inserting only the first line
I am bringing a query from one bank and I will insert in another,this running the question and that is only inserting the first line and not all the results,see my script below: <?php…
-
-1
votes1
answer63
viewshow to display user data on a bootstrap card after login is validated
hello I am developing a real estate website where I want to store user information after login, I am trying to use Yes however I am not having success in storing my user information in the…
-
-1
votes2
answers41
viewsHow do I display the search results in the database?
I have the following line in the code on my page variaveis.php $selficha = mysqli_query($conexao,"SELECT deus FROM ficha WHERE nome='$user->username'"); $ficha = mysqli_fetch_row($selficha); I…
-
-1
votes3
answers1062
viewsPHP mysql User Registration Form
I just implemented this form (Form page) on my website, but I could not connect to the database to save the records. I used the mysql_connect and she gives that mistake: changed to mysqli and still…
-
-1
votes1
answer72
viewsPHP, error making query
My problem is, I’m looking for a query, but I’m not getting all the records, and this is what I’m not getting. I’ll change SQL later, so I left it like this to test. Can someone help me?? this is…
-
-1
votes1
answer40
viewsPersonal a problem that seems very silly about the PHP connection
I’m starting basic API for personal use, but at first I’ve come across a little problem that my eyes didn’t notice the origin: Warning: mysqli_connect() expects Parameter 1 to be string, Object…
-
-1
votes1
answer5130
viewsmysqli_real_connect():(HY000/2002):
I have a problem accessing my phpMyAdmin. I started using Wampserver to program in PHP. I don’t know if I should make some initial configuration, but the way I tried to log in was without filling in…
-
-1
votes1
answer66
viewsTake the values that were changed in the bank and match the new values
I have the following question. When making changes to a certain register, I need to keep the old information somewhere, I first thought of a log scheme, but it was time to take the old values, I…
-
-1
votes1
answer94
viewsHow to average records per day in PHP MYSQLI
Hello I wanted to know how to count the average users created per day. For example: SECOND Average of 3 customers TUESDAY Average of 4 customers FOURTH Average of 3 customers and per day LAST SEVEN…
-
-1
votes1
answer36
viewsSELECT mysqli error per date
Good morning guys, all right? Here’s the problem. I put for the digital user the initial and final date to search for a certain result in the database. The Code is this: $query =…
-
-1
votes1
answer36
viewsConsult products that have the same Cod and place in an array
I want to display products that have the same order code, but when I select it displays only the first product that meets that code. $prod = "SELECT * FROM produtos_pedido WHERE pedido_cod =…
-
-1
votes2
answers91
viewsHow to sort the date in php
Good afternoon, I need to sort the dates that come from the database, by day/month/year. EX: 16/07/2020 30/07/2020 01/08/2020 $sql_listar = "SELECT idprova as idprova, descricao as descricao…
-
-1
votes1
answer45
viewsI was able to search 1 more query in the database with PHP
I’m trying to do a search in my code, searching other fields, for example, looking for people who were registered with the mother’s name " so-and-so", but I’m not getting a logic... I can only…
-
-1
votes1
answer49
viewsWarning: Division by zero with dates
how can I calculate a date range for example: 24/08/2017 and 09/05/2017 and take the total amount of days? for example the result of this difference would have to give 106 days difference from one…
-
-1
votes2
answers800
viewsIssue with updating mysql to mysqli
I’m trying to install a script from a site, but my knowledge in Php is fine, I installed the database and the files on FTP, but keeps appearing the following error: Deprecated: mysql_connect(): The…
-
-1
votes1
answer41
viewsDoubt PHP Json Array
In the query below $id_candidato = 1; $id_vaga = 2; $sql = $mysqli->query("SELECT * FROM candidatos WHERE id_vaga = '".$id_vaga."' AND id_candidato = '".$id_candidato."'"); if($sql->num_rows…
-
-1
votes2
answers46
viewsHow to join edit/new button?
I would like, if there is already $nome registered in the table, it gives an update and if it does not exist, it gives an input. I do not understand what the problem in my code. $dbconn =…
-
-1
votes1
answer245
viewsMysqli INSERT error
I am not able to identify the error. I have always set up structures like this, but now this error appears. Parse error: syntax error, Unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or…
-
-1
votes2
answers5049
viewsCheck if record exists in the table and return in mysqli
Hello I have a table called logs id | usuario_id | produto_id 1 | 10 | 20 2 | 10 | 30 3 | 20 | 30 4 | 20 | 20 They are logs stating that the user with id 10 has already seen the product with id 20,…
-
-1
votes2
answers257
views -
-1
votes1
answer593
viewsNotice: Undefined variable: connection
Recently I changed all my code mysql for mysqli. It just gave me a lot of headaches. He gives me the following mistakes: Notice: Undefined variable: conexao in…
-
-1
votes2
answers68
viewsdatabase saving only password
This is my first post here, I’ve been following the forum for a long time but I never wanted to interact, today this desire arose along with a little problem ... I’m learning to html, css, php and…
-
-1
votes3
answers1256
viewsHow to do an INNER JOIN bringing everything from two tables and one more "max" in a specific field?
Good guys, to be more specific I have two tables,. table 01: ...and table 02: ...and would like to make a "select" bringing all of these two tables, but where in the field "points" (table 02) have…
-
-1
votes2
answers48
viewsError Insert mysqli
How to do INSERT correctly? Not inserting ! $id = $_GET['id']; $queryrun=mysqli_query($conn,"SELECT image_path FROM tbl_image WHERE id='$id' "); $row=mysqli_fetch_object($queryrun);…
-
-1
votes1
answer26
viewsPost system
I think the title n was very clear but I will explain right here what I need and I am not getting good results. Well what I’m trying to do is this. On my page link it looks like this ->…
-
-1
votes1
answer269
viewsError inserting data into PHP PDO database
I am trying to create a new register in the bank with the following code and returns the error: Insert value list does not match column list or os the record is created but blank, since the fields…
-
-1
votes1
answer61
viewsConsultation with pause?
well I am making a php dynamic menu where I would not use query within another, I am currently searching from the CATEGORY table the name of the category and within it I am searching in another PAGE…
-
-1
votes1
answer64
viewsSQL search specifies
Ola wanted to do a database search with and that only brings the answer if conditions are reached used code. $sql2 ="SELECT * FROM `link` WHERE 1 LIKE…
-
-1
votes1
answer53
viewsWhen mysql_fecth_assoc, don’t you think, it kills the rest of the code, how do you make it return something?
Hello, I have a problem in this function when deleting, I do a search of what will be compared, and put two delete condition, because I need it to delete in one condition two tables, and if there is…
-
-1
votes1
answer107
viewsPHP does not save information on Mysqli
I am making a simple registration program, but I do not know why the Form data is not being saved in the Database (MYSQL). Can someone please help me with that?? Follows the Code: <?php…
-
-1
votes1
answer1130
viewsI’m having this error "Warning: mysqli_query() expects Parameter 1 to be mysqli" in php when looking up the database
Hello I’m trying to search the courses from the database.To see the courses already registered not to register in db again. I’m showing this error: Warning: mysqli_query() expects parameter 1 to be…
-
-1
votes1
answer66
viewsSql, sum of several
Hello, I have a bank with 3 important tables, state,city and orders need to rank the states than have more requests to q have less but the orders are related only to city table. so I need to make a…
-
-1
votes2
answers426
viewsView multiple records within one in Mysql
I have a question as to the mounting of a select. I have 3 tables that relate M:N as follows: Currently I am using this sql: select p.descricao, (select descricao from item where item.codigo =…
-
-1
votes1
answer58
viewsRunning time (Calculating dates) - Coming from the Databank
Someone could help me find what is wrong when calling the date of the database in the function, I am also attaching a print: On the left the actual value of the last access and on the right would be…
-
-1
votes2
answers114
viewsmysqli_connect does not connect
I’m having difficulty solving the connection with php and BD On the page of my project he presents the following message: Warning: mysqli_fetch_assoc() expects Parameter 1 to be mysqli_result,…
-
-1
votes1
answer42
viewsSave multiple data with a single identifier in mysql and php
I’m making a screen to show the discounts in opencart admin, by sub store, I can already save in a table for testing, the biggest problem is: How should be done properly in this case to be saved in…
-
-1
votes1
answer346
viewsPass data from a table to an input to update
Good evening, I’m learning php and doing a CRUD to train, I was able to select in the table and the Insert to add new data, but I wanted to click the edit button, open a modal bootstrap (I already…
-
-1
votes1
answer645
viewsHow to resolve: You have an error in your SQL syntax;
I am developing a login system, but this error is arresting me and I found no answers so far: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for…
-
-1
votes1
answer58
viewsEntering PHP MYSQLI data
Guys good night. At this moment I am trying to enter data from a form in the database. However, it is not being inserted at all. Code form: <form action="enviar-ponto.php" method="POST">…
-
-1
votes1
answer69
viewsUpdate page when entering data in database
I have a database with a table conversations,it has the following attributes: transmitter receiver hora_msg message id I need that as soon as a user sends a message ,update the receiver page, $sql =…
-
-1
votes1
answer1338
viewsmysql - Warning : mysqli_connect (): (HY000 / 1045)
<?php include"Conexao.php"; //============================================================================== $nroproduto = $_POST['nroproduto']; $nomeproduto = $_POST['nomeproduto']; $Categoria =…