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
answer451
viewsDelete Registration in Bd
I created a system for post creation. But I am not able to delete in the bank but appears the confirmation of Deleted Successfully! <?php $db = mysqli_connect("127.0.0.1", "root", "", "photos");…
-
1
votes1
answer166
viewsProblem with return of PHP’s Mysqli class fetch_all method
So, I’m doing the maintenance of a very large system. I have the query: $query = $mysqli->query("SELECT*FROM tabela"); And the problem is they used fetch_all() to return the data. When the query…
-
1
votes3
answers694
viewshow do I make a row_number keeping the document number with different plots?
I would like to know how to create a row_number keeping the numbers of documents equal creating the sequence by parcel. example: doc / cliente / parcela 10 15 1 10 15 2 10 15 3 23 59 1 23 59 2 23 59…
-
1
votes1
answer205
viewsDuplicate record in the database
Good evening folks. I am in need of a help to remove some duplicate table records from my Mysql 5.7 database By running the following query I can identify which records are duplicated: SELECT…
-
1
votes1
answer105
viewsupdate mysql attribute according to a day (12/12/2019) cakephp, mysql
I have the following problem: If a client does not pay a certain portion, he would like the system (mysql+cakephp) to place the client with the debtor status. would have some way to automate this,…
-
1
votes0
answers39
viewsError when displaying the number of records in a table
I’m using this code: /* Select Count de Ativos */ $tativos = "SELECT count(*) from ativos"; $lista_ativos = mysqli_query($tativos); if(!$lista_ativos) { die("Erro no Banco - CONTAR ATIVIDADES…
-
1
votes2
answers100
viewsRemaining minutes between field and dateAtual
I am trying to create a direct query in mysql where I must return some value if the time interval of the current date and my datareg field is 02 minutes. SELECT * FROM tabelax WHERE grade = 19 AND…
-
1
votes1
answer84
viewsMYSQLI error with _GET attribute - Fatal error: Call to a Member Function error() on a non-object in
I got a problem and I don’t know how to fix it. I am using MYSQLI to query a database using GET to get the name of the table where the query should be made. BD connection code: $hostbd =…
-
1
votes3
answers211
viewsDelete duplicate records via php in mysql
Good morning guys, I read some articles here with similar problems, but none of them answered my question, what I want. Here’s the thing: I have a query to check which lines have a duplicate field…
-
1
votes1
answer944
viewsShow Alert on select
I have the following code $query = mysql_query("SELECT id, nome, situacao FROM clientes ORDER BY nome") or print mysql_error() <select class="js-example-basic-single form-control" id="cliente"…
-
1
votes3
answers163
viewsHow can I pass php data to javascript in this case?
I need to pass the latitude and longitude data of the addresses that are within 25km’s radius to the javascript function that creates the map, follow the code I’ve made so far(Yes, I’m beginner):…
-
1
votes1
answer2417
viewsFile upload, write MYSQL name and path
Personal hail! I have the following doubt, or rather I don’t know how to do it. I have a resume form that is completed and the user attaches a.pdf file. Purpose: user fills the form name, email,…
-
1
votes1
answer75
viewsI need an SQL command to take all records that are equal in one field and different in another
I have a table that stores user data as email/ip/zip/city/region, records are added every time the user logs in, so if the same user logged in 2 times will be added 2 records, the idea is to check…
-
1
votes1
answer35
viewsQuery to list the amount(Count) of records for a Foreign key
I’m trying to create a query that lists how many times a Foreign key has appeared from another table but I’m not getting it. I wanted to count how many times each customer appears in the order,…
-
1
votes1
answer21
viewsfunction to decrease the value in 1 of the table
i wanted to make a function where each time it is called the active plot table is decreased by 1, follows the code I rode function quit() { $customer['parcelas'] = $customer['parcelas'] - 1;…
-
1
votes0
answers52
viewsHow to define a minimum time interval between database inserts?
I have a submission form, where you add comments to the database and show them on the page. The problem is, I want to draw up a form so people can only make submissions every 10 minutes. That is, a…
-
1
votes1
answer1659
viewsOn-demand loading
Guys I’m trying to make a charging system on demand and I don’t know anything about ajax and I don’t understand very well how it would work. I have a posting system that shows an amount of 10 posts…
-
1
votes1
answer75
viewsMake a START TRANSACTION does not reserve the ID of the tables involved, in case of Insert failure
Hello fellow developers, I put together a script transaction to insert values into 2 different tables, or die at the end of each INSERT, so that the insertion of data does not occur in the second…
-
1
votes1
answer1232
viewsDisplay image stored in Database
I’m creating a digital menu that contains pictures of the dishes. I stored the photo in the Mysql BD using the following code: HTML code <form enctype="multipart/form-data" method="post"…
-
1
votes2
answers325
viewsGetsqlvaluestring / mysqli_real_escape_string / Notice: Undefined variable: mysqli
I am trying to convert a function to Mysqli, to use with PHP7.1. I am having difficulties with mysqli_real_escape_string, and mysqli_escape_string. Error: Notice: Undefined variable: mysqli in…
-
1
votes1
answer189
viewsEach Database Row enter a separate DIV
Good afternoon I’m trying to make a query Mysqli , ie , I want each line of the database enters a separate div , I searched and found nothing resembling what I think is in a difficult way to…
-
1
votes1
answer383
viewsWhat are the advantages and disadvantages of using object-oriented mysqli?
I’ve always used the mysqli the way I found most practical and never noticed any differences. Then came the question: why use the mysqli object-oriented? What are its advantages and disadvantages?…
-
1
votes1
answer822
viewsEcho respecting mysql line break
I would like to know how to make the echo PHP respect the line break of a text in the database. I have a text field in the registration form like this: <textarea id="descricao" name="descricao"…
-
1
votes1
answer5104
viewsFatal error: Uncaught Error: Call to a Member Function query() on null in
My class code Users <?php class Usuarios { function listar() { require_once 'controller/conexao.php'; $sql = "SELECT * FROM usuarios"; $usuarios = $mysqli->query($sql); while ($linhas =…
-
1
votes1
answer31
viewsGroup Last Gone Returned by Insert in database
In this Script below I make a loop where inside it I enter into the bank. at the end of each insert it returns me the ID of the line saved in the variable part database (.$sql->insert_id .) so…
-
1
votes1
answer3631
viewsError: Uncaught Error: Class 'mysqli' not found
I’m using Apache to make a site localhost, but I have an online bank and wanted to access it I make the connection in php <?php $servername = "host.com"; $username = "user"; $password = "pass";…
-
1
votes0
answers31
viewsfetch_assoc() error on Boolean
I have this error in my application: Call to a Member Function fetch_assoc() on Boolean Running the same application on the local server and returns no error, on the dist server, returns the above…
-
1
votes1
answer87
viewsSend and Remove from database with Jquery
Hello! I recently did another post here but it was poorly explained. I was wanting to make a form that makes an Insert in the bank and also remove. I created a small system of titles, so users can…
-
1
votes1
answer40
viewsPermission in PHP
I’m limiting the amount of posts a user posts on a service so I created the function: function limite($conexao, $id) { $query = "select cont_post from usuarios where id={$id}"; return…
-
1
votes2
answers538
viewsDifferent mysqli_fetch array output than the one running in phpmyadmin
I have the following php code that queries the database and returns a vector with the data. public function executeSelect($query){ $resultado_id = mysqli_query($this->objetoConexao, $query);…
-
1
votes2
answers1722
viewsSelect and delete duplicate records by last update date?
Among the fields in the table there is the name field, the dt_add field which is the date that the record was inserted and dt_update which is the date of the last update of the record. I would like…
-
1
votes1
answer1500
viewsHow to use mysqli_fetch_all in PHP correctly?
I have a PHP function using Mysql, follows: public function listAll(){ $sql = mysqli_query($this->conectar, "SELECT * FROM items"); $this->desconectar; return $sql->fetch_all(); } my page…
-
1
votes1
answer461
viewsJavascript function triggered after clicking div and save data in the database
I wanted to know if you can put a javascript function after clicking and dragging a div (better still: after "drop" the div). I intend to make a code so that every time I move the div to a table…
-
1
votes1
answer58
viewsScript to remove readonly
I have a user registration system and a page where I show all registered users. I display 8 users per page - each user has the option to click an anchor Info which details the user. In these details…
-
1
votes3
answers349
viewsMysqli + num_rows after a table query
This is supposed to be a login system with access levels that I’m trying to do, but it’s giving an error. What am I missing? I’ve tried everything and nothing. I’ve looked at the PHP documentation…
-
1
votes2
answers132
viewsConditions in the SQL
Hi, I have a question in SQL. In the company system there are several registered products, and these products have different sales unit, that is, some are sold by Package, Box, Unit and etc... Every…
-
1
votes1
answer161
viewsLike php mysqli
I’m working on a system of Likes (likes) but things are very confusing, I have the Post table (The content to be liked) with the following columns |ID|TITLE|CONTENT|LIKES| In the column LIKES,…
-
1
votes1
answer144
viewsSite only works local, does not work online
I have a simple connection that my application uses to connect to the bank mysql. Locally everything was fine, but putting it online no longer works. I have changed several possible terms to the…
-
1
votes1
answer156
viewsPHP/Mysqli(phpmyadmin)
Good guys, I need help with the following: I want to insert 3 simple information in the database, product name, price and image. Outside the form I opened a tag to show the output, but it only shows…
-
1
votes2
answers367
viewsMysqli vs PDO - query/function execution
Looking at questions here from the stack and the php.net website, I saw that query/function executions in Mysqli use if() to check whether it was executed or not, and the PDO uses try { ... }…
-
1
votes0
answers117
viewsPHP error: Too Many Connections
I’m getting some messages from my application, from many running connections. PHP Warning: mysqli_connect(): (08004/1040): Too many connections in /home/rmour123/public_html/admin/conexao.php on…
-
1
votes2
answers114
viewsSearch with null value, mysql
I’m a beginner in programming and I’m trying to find something new, in this case, I have two fields that inform my research values, but I wish the research could be done even if a field is null This…
-
1
votes1
answer48
viewsQuestion about PHP , where I can’t make an exclusion with one condition"
so I’m not getting it right about an exclusion code where it contains a condition, being that if a registered course is a foreign key in the user table the same cannot be excluded from the course…
-
1
votes1
answer1962
viewsSQL account how to sum and subtract
I’m starting to learn SQL I need to do an account, I have a select for a report where I need to do an account to show another value in the fields in that report and the formula cannot appear in that…
-
1
votes1
answer1060
viewsLimit the number of pages in PHP MYSQL paging
I have a pagination in PHP and MYSQLI, and I would like the link of the pages below to be limited, for example: Pages: 1 2 3 4 5 (goes up to 100), appear only the first 5, if I have on page 10,…
-
1
votes0
answers139
viewsMaps Javascript Api - Problem saving searched location in Mysql database
I need that when the user clicks the save button that appears when Mark receives a click, the location information is saved to the database. Hidden fields that receive location values when searched:…
-
1
votes0
answers347
viewsMYSQL - Detect sequential break with conditional
Hello I need help to make a query or process to detect gaps in a numerical field, I have a table of tax notes, which has a field num_nfe, it must follow a sequence, there can be no gaps in the…
-
1
votes0
answers35
viewsHelp: I can’t import information from a URL to my bank
Gentlemen I am trying to collect information from a URL and send to my DB, in the url the information comes all mixed, with the scritp I can already organize them as follows: [1] => Array (…
mysqliasked 6 years, 7 months ago Rodrigo Soares 11 -
1
votes1
answer245
viewsMysql comparing a number with string returns true if the string starts with the number
I have the following table in the database: idUser - Username - Group 1 - John - 5GR 2 - Donate - 1GR And the following query: SELECT * FROM `table` WHERE `idUser` = '$name' OR `Group = '$name'…
-
1
votes1
answer277
viewsDoubt about highcharts and php
For styling a web page, I usually use highchart charts with information from a mysql database via php. For those who are not familiar with highcharts, here is a simple code example.…