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
votes2
answers461
viewsHow to recover the `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;…
-
0
votes0
answers59
viewsCode is not sending data to the database
This first code for registration is not working, it is equal to another that is working that registers users, is giving error in $insert name and display the message Unable to enter record:, I tried…
-
0
votes1
answer40
viewsWhy are the values repeating if there is no data in the database?
I can’t seem to solve this problem! When I attend on a particular day, the ***status** of this day is repeated throughout the month**. In the example below, I did the day 1, then I did the day 2 of…
-
0
votes1
answer188
viewsCheck and Insert Data in a Table
Good evening, I’m implementing a very basic Facebook login system on my site, the system should capture the basic data (id, name and email) of the user and save in a table and that’s where I’m…
-
0
votes1
answer48
viewsProblem with php code to send simultaneous messages to the database!
I’m trying to create a code covers send messages between users of a system in php, the problem and I can send the message from one user to another but wish it was possible to send to all users, or…
-
0
votes1
answer72
viewsError when displaying bank return in Mysqli
Guys, I’m doing a PDO login system I don’t understand much, but I’m going through this problem, I developed the following code below: $select = $con -> prepare("SELECT * FROM conta WHERE conta =…
-
0
votes1
answer82
viewsForm for the registration of equipment with sequence of lot numbers
someone could help me with this problem. follow the code: <?php $equipamento = $_POST['equipamento']; $departamento = $_POST['departamento']; $observacao = $_POST['observacao']; $NInicial =…
-
0
votes0
answers38
viewsGives error when executing this query in the system that generates reports
Error executing this query in the report system, but directly from the database returns right> ERROR>>> ORA-00942: table or view does not exist Stijdbcdatabase The consultation is a very…
-
0
votes3
answers90
viewsHow to do more than one select in the same query in different BD tables?
The problem is this: I have the tables: Which are foreign keys in the following table: And I need to pull all the column names "modelo_conector", "nome_genero_conector" and "tipo_de_conector" and…
-
0
votes3
answers2846
viewsBlock access to PHP pages with SESSION
I am practicing PHP. I’m setting up an admin panel with login screen. I have my index.php page which is the login (EMAIL AND PASSWORD). After logging in, direct the administrative page.php The…
-
0
votes1
answer31
viewsFilter query for mysql dates
have this mysql table: And I have the following appointment: SELECT * FROM tabela WHERE 1 = 1 AND data_prova >= '2020-03-01' AND data_prova <= '2020-03-26' Well, with this select use for a…
-
0
votes2
answers109
viewsHow to use sprintf to create a query with date_format()
I am reformulating a system of a client and the same is using procedural mode in login and not PDO, but to give more security, I used the sprintf, but it’s not working. Look: $sql = sprintf( "SELECT…
-
0
votes2
answers142
viewsWord problem using quotes when doing INSERT SQL
I’m having problems when I will perform the Insert in mysql when I have a word that contains ex Quotes (box d'agua) in any input form, when I have the mysql error saved. I have already changed the…
-
0
votes1
answer38
viewsAssign values from a select to a variable
Well I am mounting a procedure in Mysql, and inside it I have the following code: DECLARE valorConta DECIMAL DEFAULT 0; DECLARE valorPGConta DECIMAL DEFAULT 0; SELECT Valor INTO valorConta FROM…
-
0
votes1
answer18
viewsData display does not work
I need to display records coming from the bank, I’m doing this through a while and inserting each field into a td, but if I don’t limit the number of records in the select itself, they’re all on the…
-
0
votes0
answers46
viewsSELECT in a time period in a datetime column
I have the following column id datareg 1 2020-07-24 08:00:00 2 2020-07-24 08:30:00 3 2020-07-24 08:45:00 4 2020-07-24 09:00:00 5 2020-07-24 13:00:00 I need a query that returns the AMOUNT of records…
-
0
votes0
answers19
viewsI’m having trouble validating access in a system
Warning: mysqli_query() expects Parameter 1 to be mysqli, string Given in Sqlfunctions.php on line 13 Login.php: <?php if(isset($_POST['usuario']) && isset($_POST['senha'])) {…
-
0
votes1
answer6504
viewsHow do I resolve Access denied for user ''@'localhost' (using password: NO)?
People I am doing here a simple screen that makes a query to the database, the first time I created everything went well, but now I appeared this message "Access denied for user '@'localhost' (using…
-
0
votes1
answer53
viewsUpload Images with PHP + Mysql
I am working on a project that requires the employee’s registration with his image on the form. So far so good, is performing normally the insert, both the data and the image. But when I try update,…
-
0
votes1
answer40
viewsHow to individualize database queries with PHP?
Hello, good morning. I have the following problem: I want to handle SQL output using PHP, displaying the values individually and custom. For example, I have a database with the values Tomate |…
-
0
votes2
answers36
viewsProblems performing database search (Filtering)
I’m having a problem running a database search. I have 3 research fields, City, Neighborhood, and Product, I want the user can filter the 3 or just City/Product or City/Neighborhood, however works…
-
0
votes1
answer172
viewsImage gallery with Carousel Boostrap. name.jpg separated by , no db!
I want to create an image gallery using bootstrap Carousel, when saving the multiple images in db they go to the same column "photos" and are separated by "." (foto1.jpg,foto2.jpg,foto3.jpg) Now I…
-
0
votes0
answers15
viewsRanking with php msqli
hello gentlemen I’m studying php and msqli I’m having a hard time to make a ranking prq the team plays as visitors but sometimes as a boss so I need to add when it appears in both situations. for…
-
0
votes0
answers21
viewsNumber of aborted connections too high MYSQL/Mariad
we have a Mariadb server here, and was analyzing these days because the same is a little slow, and I came across these numbers, someone could explain to me better what this means, and if possible…
-
0
votes0
answers43
viewsDifficulty with mysqli_fetch_object
I’m performing the function as follows: Through a query: <?php [...] $sql = "SELECT f_u.*, f_i.*, f_g.* FROM form_user AS f_u LEFT JOIN form_imovel AS f_i ON f_i.imovel_id = $imovel_id LEFT JOIN…
-
0
votes2
answers203
viewsDelete button does not work
I created a delete button that sits on the row of each record that I am displaying in a table, but when I click on it and display the delete screen, I realize that the last record of the table is…
-
0
votes1
answer36
viewsThe posts are getting on the last page in the PHP MYSQLI pagination system
Good evening. Can anyone help me with a problem I’m having? Well... I did a pagination posting system, but when I add more data into the database the new data is on the last page instead of the…
-
0
votes1
answer26
viewsCONCAT WITH ERROR
SELECT b.numero_contrato as name, CONCAT( sum(CASE WHEN a.status = 'Concluida' THEN 1 ELSE 0 END) AS concluidas, sum(CASE WHEN a.status = 'Recebida' THEN 1 ELSE 0 END) AS recebidas, sum(CASE WHEN…
-
0
votes2
answers54
viewsDjango: Optimize Database Searches
I am doubtful in the following exercise: The route /Albums/ is returning a listing of the albums with the artists of the album, but in some of our clients that use databases stored on own servers it…
-
0
votes1
answer141
viewsArray result returns null
I need it from the option selected on <select>, me check in the bank what is related to this option. I did this from way that follows below, but in part $p_id = $result['p_id'];, no return, I…
-
0
votes1
answer1423
viewsWarning: mysqli_fetch_object() expects Parameter 1 to be mysqli_result, Boolean Given in /home/omeganim/public_html/index.php on line 39
I am in need of help to resolve this error!!! Warning: mysqli_fetch_object() expects Parameter 1 to be mysqli_result, Boolean Given in /home/omeganim/public_html/index.php on line 39 The code is…
-
0
votes1
answer446
viewsSELECT always returns the last record
I’m trying to make it the moment I select an option in a select other fields are filled in using this information. I managed to do this partially, always selected the last record of the table I’m…
-
0
votes1
answer42
viewsProblem returning PHP function
Good afternoon, folks I’m starting in php and I’m having a problem with my code function buscarIdProduto($conn,$nome){ $stmt = $conn->prepare("SELECT id FROM produto WHERE NOME_Produto = ?");…
-
0
votes2
answers64
viewsDifficulty adding data to db using PHP and MYSQL
Well, I’m starting my studies in php and mysql, and I’m having a hard time doing something theoretically simple, which would be a form that sends the information provided to a local db. By pressing…
-
0
votes1
answer82
viewsProblem while doing update
I have on the site the system to register, list and edit users. Registering and listing are ok, however, when trying to update a record, it is not changed on DB and also does not return any error. I…
-
0
votes1
answer49
viewsDifficulty adding PHP MYSQL data
Well, the title itself is self-explanatory. Perhaps the only relevant detail I can add, is the fact that when performing the operation I get no error, nor Warning. Thank you in advance for your…
-
0
votes1
answer59
viewsDoubt JSON PHP
I’m trying to display on the screen a structure JSON which will be built by Mysql, but I would like to separate the results into groups according to the name of the fields I set in select and would…
-
0
votes1
answer91
viewsSelect limiting query, and does not display the latest queries
In this script, it is limited to the display of 6 queries in the SELECT variable $quantidade_pg = 6, I used the IF to inform that all news situations other than 2 (unpublished) should be displayed.…
-
0
votes1
answer94
viewsTaking data from a table from grades average of another table?
Tabela - lista id | nota 1 | 10 2 | 8 3 | 7 1 | 8 3 | 9 I want to average the notes of those who have the same ID, and for that I created the following query: SELECT AVG(nota) FROM lista GROUP BY id…
-
0
votes1
answer39
viewsDoubt Mysql + PHP
Hello, I am developing a management system of camepeonatos online (Fifa, pes) and I have a problem, now I am doing the part where the user will post the result of the game, informing the score and…
-
0
votes1
answer929
viewsCall to a Member Function fetch_object() on a non-object
In the following code, the following error occurs, which I cannot understand why: Call to a Member Function fetch_object() on a non-object at line 21 <?php require('config.php'); if…
-
0
votes0
answers57
viewsHow not to insert data into the database with mysqli and php?
I wonder if anyone can help me is that I don’t want to enter in the database values where the title is equal but I’m not getting. With the code below it always inserts in the database, not this…
-
0
votes2
answers404
viewsProblem in Insert shows no error
Everyone all right? I’ve searched the entire forum and even other forums and couldn’t find answers on this. If anyone can take a look and point out my mistake I’d appreciate. Follow the form:…
-
0
votes0
answers465
viewsUpload multiple files in the same form and write name in the database
I have a registration form with two file input. One called file (an image) and the other called arquivo_download(a pdf). In my table I have a column [image] and another [downloads], which write the…
-
0
votes3
answers71
viewsdifferentiate user type with php
I have a registration system of my system that has two types of users: teacher and student. has a field on the form that is the "user type" of which you can be a teacher or student. I made a code,…
-
0
votes1
answer121
viewsUse php to set column width depending on while result
I have the following code $result_categorias = "SELECT * FROM categorias ORDER BY ordem ASC"; $resultado_categorias = mysqli_query($conn, $result_categorias); $total_categorias =…
-
0
votes1
answer120
viewsAjax PHP Combobox Returns nothing
I can not return anything .. when I test instead of the city field and erase there it returns but with the name of the city it does not return has data limit for a CMB? $(document).ready(function()…
-
0
votes1
answer111
viewsVariable not defined in SQL query for PHP
I am trying to send an array in PHP, a query with the information of a table in Mysql, but I am finding the following error when I try to print an array position: "Notice: Undefined variable: array…
-
0
votes1
answer908
viewsConvert image size before saving to BD
I would like to increase my processing code: // Local onde imagem vai ser salva $_UP['pasta'] = '../../media/'; // Tamanho da imagem $_UP['tamanho'] = 1024*250; // 250Kb // Exrensões permitidas…
-
0
votes1
answer184
viewsMYSQL average per minute
Hello, in the table below, you have to do a select that returns the following: select the average current per minute between day x and day y and on return display the day and minutes? I have a…