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
-
0
votes1
answer150
viewsDo not repeat returned Mysqli data
I have this code that brings me the months registered in the bank. But as it has several lines, I want to return only once each value. // Fazendo a conexão $conexao =…
-
0
votes2
answers268
viewsDatabase does not save data in php, although no error returns
Hello :) I am starting learning with PHP, trying to insert data from the database. Although no error returns, the data is not saved. Here is the code: <?php…
-
0
votes1
answer123
viewsQuestions form with radio button returning empty displaying
Good night, I need to ask a question system (a question) just like this: https://jsfiddle.net/hmana2sL/ I just need the questions and the answer options to come from the bank. I tried this way only…
-
0
votes1
answer384
viewsHow to return the sum of values of a limit column in Mysqli
When I run directly in the bank select sum(peso) from (select peso from dados order by id asc limit 2) as subt me returns the expected value. When I run in PHP with the variable $num=2 no return…
-
0
votes1
answer45
viewsError in mysql Syntax
I am making a page to list the products I have in my database, but when loading the page I get this error that I cannot solve: Warning: mysqli_fetch_assoc() expects Parameter 1 to be mysqli_result,…
-
0
votes1
answer2546
viewsParse error: syntax error, Unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or Identifier (T_STRING) or variable (T_VARIABLE) or
I can’t figure out where the mistake is. I believe it’s on my face, but I can’t find it! $inserir = $conexao->query("INSERT INTO cadastro (nome, sobrenome, email, senha, contrata, trabalha,…
-
0
votes1
answer275
viewsHow to make encrypted password queries in the database?
Well, I created a function called search party that should encrypt the user’s password and compare it with the database but every time I run I get the error: Warning: mysqli_fetch_assoc() expects…
-
0
votes1
answer51
viewsIs that a server error?
I have developed an application in which on my local server is working perfectly. So when I put on the web server is returning me the following error: Fatal error: Class 'mysqli' not found in Can…
-
0
votes2
answers60
viewsSave to the bank who edited profile
I’m developing a system that registers employees of companies. In this system I have the staff tables and users. Table employees have the data id|nome|empresa|data_cadastro|user_view|user_edit User…
-
0
votes1
answer105
viewsQuery with duplicate data in Mysqli
Hello. I’m having trouble displaying results of a bank consultation. I have 2 tables Tabela 1 - logs // logs do sistema //user_id = são os usuários administrativos do sistema //user_perfil = é o…
-
0
votes1
answer2801
viewsMYSQLI - Trying to get Property of non-object in
I have the following function: function sql_update_views ($table = null, $id = null) { $database = open_database(); $found = null; try { $sql = "UPDATE ".$table." SET views = views + 1 WHERE id =…
-
0
votes0
answers420
viewsAccess error denied for user in connection
Can anyone tell me why I’m finding this mistake ? Warning: mysqli_connect(): (HY000/1045): Access denied for user 'clienteaces'@'localhost' (using password: YES) in C: Program Files (x86)…
-
0
votes3
answers69
viewsHow can I check equal variables within a while
How can I check equal variables within a while? Like if there are lines like the same CODE do something... A Bass put my example $bd = new MySQLiConnection(); $sql3 = $bd->prepare( "SELECT * FROM…
-
0
votes1
answer496
viewsList Login User Post
I’m a beginner in PHP and I’m making a system where the user can register and register and post, it’s a blogging system. I built the user with SESSION and can display only his data. In my database I…
-
0
votes1
answer129
viewsWhy isn’t my consultation working?
I have a query in a table that should return the amount of records found that meet a certain requirement. The code: <?php require('conn.php'); $prevJan= "SELECT COUNT(ID) AS PrevJan FROM…
-
0
votes1
answer369
viewsMy login won’t catch $_SESSION
I have the following codes: Conn-login.php: <?php session_start(); header('Access-Control-Allow-Origin: *'); //Conexão MYSQLI - LOGIN GLOBAL $mysqli = new mysqli('localhost', 'login', 'senha',…
-
0
votes1
answer737
viewsImplement a PHP and mysqli like button
I’m trying to implement a like button on a system I’m creating for testing. It already changes the value of the likes in the database, but I have to put the value in an input field that I put. So…
-
0
votes0
answers84
viewsLogin System - HTTP ERROR 500
I am making a login system, but when submitting the data it from HTTP ERROR 500. I tried to change the code anyway but this error continues. I am using 000webhost to test how the site is getting,…
-
0
votes2
answers939
viewsError: mysqli_fetch_assoc() expects Parameter 1 to be mysqli_result, Boolean Given
In my project I put a search bar, in which the user informs a value to be searched and selects the column in which he wants to search. What will be searched comes from an input type="text" field and…
-
0
votes1
answer229
viewsmysqli_insert_id() is returning 0 when used inside an insert
Every time I try to catch the id of that first INSERT, for mysqli_insert_id(), he returns 0 in the second Insert and returns the correct number in the header below, which can be?…
-
0
votes1
answer60
viewsMysql Cross Query
I’m not sure how much to express myself more than I need is how I can do a normal and reversed query. Below I have two fields one of origin and the other of destination. I need to make a $origem =…
-
0
votes1
answer34
viewsError when trying to insert data into a database
I have the following duties: function query($stmt){ try{ return mysqli_stmt_execute($stmt); } finally{ mysqli_stmt_close($stmt); mysqli_close($GLOBALS['conexao']); } } function…
-
0
votes2
answers128
viewsSave filename in BD and access them later?
I want it to be available when uploading a pdf or ppt file on the site so that the admins of the site can download. I’m managing to save the file in a folder, but I can’t save in the database, does…
-
0
votes3
answers116
viewsSave multiple records in the bank
I’m using the following code unsuccessfully. $conn = mysqli_connect('localhost','user','pass','banco'); try { $body = file_get_contents("php://input"); $dados = json_decode($body); foreach($dados as…
-
0
votes1
answer98
viewsPhpmyadmin does not save file if you already have one saved
I made a code to save the name of a file in the Phpmyadimn database, it works if the table is empty, but when I try to attach another file it error, does anyone have any idea why this occurs?…
-
0
votes2
answers740
viewsInner Join mysql 2 tables
Good evening guys, I need to link two tables and I’m not able to correct or find where I’m going wrong. I have two tables: Table 1: br_regiao | id - iduf - name - (1 , 1, Litoral) Table 2: br_estado…
-
0
votes1
answer153
viewsShow all database files on a php page?
Guys, I made this code to display all the files that were attached by the user, but it only shows the file with the smallest ID, IE, the first files in the database. That’s the code I used: <div…
-
0
votes0
answers31
viewsPHP code just doesn’t start when loading the page!
I made the code below to show the files that were inserted by the user, however it only shows the files after having attached a file, however I wanted it to show when loading the page, for the user…
-
0
votes0
answers46
viewsMysqli only runs if you have a Ubmit?
Hello, I have a code, explained below, where I want to make available the files that users uploaded for download, for this I made a php code, but the query is only executed if I upload a file, but I…
-
0
votes0
answers42
viewsProblems with Php and Mysqli
I recently uploaded an old code for Mysqli and it’s giving errors. Erro: Notice: Undefined variable: connection in /var/www/public_html/includes/functions.php on line 8 Warning:…
-
0
votes0
answers34
viewsI made a code to send on the screen the number of Cpf, It is working but acknowledging an error!
<?php include"conectar.php"; $query="select cpf from teste where cpf = '" . $cpf . "' order by teste"; $stmt=mysqli_query($con,$query); if($stmt) { $today = date("d.m.y"); } else {…
-
0
votes1
answer44
viewsSelect database data within another while?
I have a calendar made by me, not very good, but made by me, in which has a while creating squares, ie the days, of the current month. So far so good, but now I would like, if a certain day had an…
-
0
votes2
answers152
viewsdoubts about the variable session_start()
I put the method session_start() to make the user name appear on the screen when he logs in to the following pages, but I wanted to put his "name" instead of "email" follows the code I did: Code to…
-
0
votes1
answer218
viewsI want to display data from a foreign key table in my main table, how do I do?
In PHP as I do instead of the foreign key id, the field that has the data appears? I have a table room that has, column id, spine nome and column tipo. And also I have the table of movies, the movie…
-
0
votes2
answers255
viewsError returning data from php + mysqli database
I am Filling the select with database data it reaches up to the part of the select in the neighborhood table and returns the city ids but it does not enter the loop of the clients table where it…
-
0
votes1
answer59
views -
0
votes0
answers91
viewsConversion to PDO
I would like your help to transform the following code to PHP PDO. I made the following conversions and commented on the front of the code, just to answer the question. It is if the conversion is…
-
0
votes1
answer235
viewsRedirect to another page when giving error in registration!
I have a registration system, which does not allow the user to register with an already registered email, but when I register with an existing email, it does not redirect the user to the…
-
0
votes0
answers65
viewsDisplay an image if the value "7" is in the "Code" Row
I appreciate the help you will offer me. I have tried many things, but now I am not moving forward at all. I managed to put this code but it doesn’t show me any picture. Up on top of me $results =…
-
0
votes1
answer125
viewsI cannot find Login error
am logging in, but even when I put the data of a registered user appears invalid data. login.php <?php session_start(); require_once "Classes/UsuariosDAO.php"; require_once…
-
0
votes1
answer37
viewsError in selection query about social network requests
Hello, in my project I need to list the people and requests received by the user, but when listing people, I need to list only those who did not submit or that the user did not submit requests, in…
-
0
votes1
answer189
viewsTraverse rows of a table within loops
What I intend to do is schedule times and dates on front-end according to the records of a table, but with the code I have I can only mark the first row of the table. How to go through the entire…
-
0
votes0
answers207
viewsProblem mysqli_fetch_assoc() | is nothing to do with bolean ;)
I am new here, I have a problem with the code below: someone can give me a light? Code.: <tbody> <?php while($linha = mysqli_fetch_assoc ($resultado)) { echo '<tr>'; echo…
mysqliasked 6 years, 11 months ago Luis de Souza 1 -
0
votes1
answer185
viewsHow to check if the mysql result number is empty?
I’m having some difficulty displaying a message when the query does not return results. When the select returns 1 result "if(mysqli_num_rows($result1) > 0)" is showing correctly, but when it does…
-
0
votes1
answer64
viewsError in the Database
I am trying to make every time the user clicks a button happen an UPDATE, but for some reason gives the No database selected, what’s wrong with that code? Update.PHP <?php require_once…
-
0
votes2
answers47
viewsHow to pull a die from the same field?
Come on, guys, I know my question might be silly... But how can I pull data from a field only in SQL. It’s just that I’m actually putting together a report of the company’s products... There are…
-
0
votes3
answers149
viewsFind a certain number inside a mysql string
Good morning, everyone. I’m having a question I can’t seem to solve. In a given table of a BD I have a column that saves a string as follows: 1,2,3,4,5 Line 1 11,22,33,44,55 Line 2 Now I need to do…
-
0
votes1
answer34
viewsUnexpected result in database query
<?php class Login{ public function logar($email,$senha){ $connect=new DB; $connect=$connect->conectar(); $sql="select * from usuarios where email='$email' and senha='$senha' and status='1'…
-
0
votes0
answers31
viewsCatch result from next line
Hello! I am working on a series guide and I am wanting to create a forward button, in case when it is clicked, it go to next episode... On the screen there is a forward button that would change…
-
0
votes0
answers64
viewsDifferent results between localhost and server
I have the query below that works well on localhost but when send to the server does not work What can it be? SELECT CONCAT( mes, '/ ', ano ) AS data, IFNULL( SUM( total ) , 0 ) AS Total FROM…