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
votes0
answers48
viewsQuery to return followers of friends
I’m starting in SQL and I’m having trouble making a query with multiple lines returned. I’m creating a generic twitter clone. Goal: Return users who are followed by the people who logged user…
-
1
votes1
answer34
viewsQuery the database using ORDER BY kills my search
My code displays a list of people and a search field at the top. everything works normal, including the search. But I need people to show up at random. The problem is that when I use ORDER BY Rand()…
-
1
votes1
answer164
viewsGenerate report between two dates with php and mysqli
I’ve been racking my brain for a while, and I need help. I have a code that retrieves a date from the comic book and compares the days difference from that date to today. If this difference is less…
-
1
votes1
answer253
viewsforeach to insert multiple Rows
I am trying to insert several Rows into a Mysql table with the user-filled content in an HTML form, when it does Submit. What I need is that when several options are selected in the options of a…
-
1
votes1
answer707
viewsHow to Recover Variable Value in a Bootstrap Modal Window
My problem is this: I have this code that displays several cars on a table: <?php $veiculos = "SELECT * from veiculo "; $veiculos .= "WHERE id_secretaria = '1' ORDER BY placa DESC LIMIT 2";…
-
1
votes2
answers2153
viewsHow to refresh the page without forwarding information to the php database
I am working on a simple message system, and it works, but whenever a refresh is given on the page, the information of the last Internet is sent back to the database. And if nothing has been filled,…
-
1
votes1
answer147
views -
1
votes1
answer109
viewsHow to make a condition with mysql php number
Hi I’m doing like a virtual bank in one part has to make the deposit, the user has the wallet money for example. I have 500 real in my wallet but if I put any value over 500 it deposits into the…
-
1
votes2
answers86
viewsUser with more than one profile
In the business rule of the system I am working on, a user can have more than one profile. Profiles are: administrator, evaluator and responsible. For example: So-and-so can be an administrator and…
-
1
votes2
answers267
viewsSQL helps to join 2 selects
I have 2 selects below, how can I join in only 1 select? I need to take everything that sold in a certain period (BETWEEN) by item only that at the same time I have to take what had stock of the…
-
1
votes1
answer1842
viewsInsert quote text in mysql database
I am using the following code to insert a quoted text into a mysql database: mysqli_query($con, "insert into medicacaohistorico (data, unidadeori, unidadedes, itemdetalhe, qtd, solicitante,…
-
1
votes1
answer42
viewsmysqli num_rows expects Parameter 1 to be mysqli_result
Hello, I’m a beginner in PHP and Mysql and I’m in need of help. I am getting the error that is in the question title in my login function: public function login ($login, $senha) { $result =…
-
1
votes1
answer298
viewsSearch and display of results 2 tables mysqli/php
I wanted to do a search in 2 tables (news and photos) and then display the results of this query below. But the fields I have in each table are different and I’m not able to elaborate a way to…
-
1
votes1
answer101
viewsCOUNT with conditions and selection without WHERE at the end
In my table I have 3 columns: id(INT) auto increment tipo(INT): the values are 1 or 2 id_usuario(INT) I need a means without the WHERE at the end to know if there is a user-specific data, and if…
-
1
votes2
answers133
viewsError inserting PHP + Mysqli data
please could help me with the error below, I’m trying to Ravas this code data in a table but when I ask to record is returning the error: Fatal error: Uncaught Error: Call to Undefined Function…
-
1
votes1
answer179
viewsAdding +x to each record returned in a SELECT
For example, in a select in the bank, will be returned 5 records: SELECT * FROM esc_usuarios WHERE usu_indicador_codigo = '" . $_SESSION['codigo'] . "' AND usu_situacao = 'ativo'" Then I want to…
-
1
votes1
answer72
viewsTake larger ID and insert Bank
My doubt is the following need to take the ID with higher value and enter the information in it. The PHP file is working but I need it to identify the ID with higher VALUE and insert it instead of…
-
1
votes2
answers233
viewsError when associating connection variable (PHP/Mysqli)
I’m finding it difficult to call a variable from an auxiliary php code, which connects to my database, in my HTML page. I searched in several contents, but I did not find solution to this problem,…
-
1
votes1
answer51
viewsAdd values to a database by PHP
I’m trying to add values to a database through PHP. I am using Phpmyadmin for both databases and also for the site in question. At this point the code I have is the following, I present my doubts at…
-
1
votes3
answers69
viewsHelp with select in MYSQL
I would like to know how I do to list for each city the oldest clients, tried several commands but without success. I would like you to quote automatically. Below some commands I used, however I did…
-
1
votes1
answer292
viewsLaravel informs that the page was not found: 404 on the master/test route
How to make this update work? Below page code. Form_edit.php <form role="form"> <div class="box-body"> <div class="form-group"> <label>Name</label> <input…
-
1
votes2
answers822
viewsImport data from a mysql table
I have a database Mysql and I am trying to import the data from a table that the customer passed to my default table. Using the script below, no error appears, however import is not done, table…
-
1
votes2
answers2648
viewsCreating a simple database with NOT EXISTS
Every time I create a DER(Entity-Relationship Diagram) in a database, and then type this diagram in the Entity-Relationship Model, to scan the created diagram and also to perform the insertion of…
-
1
votes1
answer34
viewsQuestions about data listing!
Hello I am developing a project using the Mysqli extension, and in this taking advantage to use some object-oriented functions! I would like to ask a few questions regarding the data listing, are…
-
1
votes1
answer348
viewsDisplay photo of logged-in user from SESSION
I’ve been having trouble with this PHP code for days. I’m developing a simple user registration system, but I’m using access levels, so far so good! I can already display the user name through…
-
1
votes1
answer26
viewsFetch field name and Insert into
Good, I wonder if someone could give me a little help? I am trying to make a dynamic Insert, where the user chooses in a select box in which table will insert the data. But I would like that when it…
-
1
votes2
answers47
viewsPHP - I can’t update the database
I can’t update the database, someone can help me pfv? <?php $ligaBD = mysqli_connect("localhost", "root", "", "pap"); $tipo_autorizacao = $_POST['tipo_autorizacao']; $autorizacao_obs =…
-
1
votes0
answers22
viewsRemove the underside of Radialgauge
I have a gaugechart where it was mounted at an angle of 180º, but it continues to show the 360º, thus occupying an unnecessary space. How can I remove that part underneath the chart ? Follow…
-
1
votes1
answer44
viewsFunction to edit returning NULL PHP and MYSQL
Good night to you all, I am a beginner in programming and am following a tutorial to create a stock control system. if(isset($_GET['id'])) { $idFabricante = $_GET['id']; var_dump($resp =…
-
1
votes0
answers29
viewsUnable to change field in php when id is not 1
Good evening, I’m trying to make a change to my database through php, but when clicking on "change" it only allows if the code is equal to 1, I have already put in html to send the id as soon as we…
-
1
votes1
answer46
viewsUsing select the same select more than once
I need to wear the same select other times, but I’m not getting it. It shows the result in the first while, but for the rest not. On the same screen I will repeat by 4x, because I am referring to…
-
1
votes1
answer32
views -
1
votes1
answer30
viewsSelects post sorted by id
opa, Ai friends... well, the problem I’m having, I made a query to the database where I get all posts ordered by descending id, and just doesn’t work... it selects only the first. follows the code…
-
1
votes1
answer149
viewsHow to configure mysqli TIMEOUT in PHP?
I have some servers I have to test if I have a connection. Some of these servers have blocked access to my machine for testing, so they’ll give the message Can't connect to MySQL server on. However,…
-
1
votes1
answer451
viewsShow last record of each person in a Mysql table
I have a table "conversations" in the database where I have transmitter receiver message id another "users" table that is not very relevant, however, I want to show in an html table the messages…
-
1
votes0
answers58
viewsHow to associate values (price) passed through the mysqli_fetch_array to a product?
I wonder how to associate some values I have stored in a array is a specific product, follows below my code: <?php while ($consulta = $result->fetch_array()) { ?> <!--laço para dispor…
-
1
votes0
answers28
views -
1
votes1
answer83
viewsHelps in date formatting from the database
I am finishing a data filtering system coming from the Database, using BETWEEN, my difficulty is in formatting the field 'date' to timestamp to do the filtering, follow my code: $where = "date…
-
1
votes1
answer63
viewsShow specific dates that are in the Database in Bootstrap datapicker
I need the datapicker to load specific dates dynamically, which are saved in the database, I was able to get it to load manually, but there are several dates and may vary as the user saves in the…
-
1
votes1
answer117
viewsMysql query with 3 different criteria within the same table in the DB
I need to create a query Mysql/PHP with 3 different criteria, but within the same BD table. Tabela Negociações (Nome: tbl_neg) ID STS VALOR 1 1 R$23.000,00 2 2 R$60.000,00 3 1 R$10.000,00 4 1…
-
1
votes0
answers37
viewsGroup a date field in months
Good afternoon, could someone help me? How can I put this query to display from January to December correctly? SELECT EMPRESA,ATIVIDADE,DATA,STATUS FROM tbl_atividades WHERE YEAR(dt_vencimento) =…
-
1
votes0
answers95
viewsSum the total values entered in a table - PHP
I would like to add up the total values entered in the database and presented in a table. Add up all values including new releases. Stages: 1- Register value and send to the Database (registration…
-
1
votes1
answer104
viewsHow to generate javascript functions within while
I am developing a Soundboard, and in this code, each <audio> is generated by record found in the database, and each of them has a volume controller, however, all controllers only work pro last…
-
1
votes1
answer223
viewsHow do I create an alert through a Trigger by not blocking the Insert?
Guys, usually whenever I create a Rigger is to perform insertion blocking or only update values. But this time I just need the system to alert not stopping the person performing the document…
-
1
votes1
answer351
viewsFill in input according to select
I need when you select something in select to make a call in the database via ajax and return. The problem that nothing happens. This is the Index script or Javascript: <script…
-
1
votes1
answer43
viewsDatabase connection via external file (PHP)
I am making a form and for this I have created a database where such data will be saved. I would like to make the connection to the database from an external file, so it is necessary to just call it…
-
1
votes3
answers159
viewsError in php/mysql register
I made a login and registration system, and within the registration section I put a condition, if true register, if false do not register. However, as much as if Else is true, when I enter the…
-
1
votes2
answers86
viewsConsult the last 3 days in which there was record in the table
I have a table called OperacoesCaixa and in it I have the following fields: Cod, Valor, DataOp Well I need to make one select that I return the releases of the last 3 days, but I do not want to…
-
1
votes2
answers36
viewsConsult related data without repetition
I need to list all data in the CONTRACT table, but only when in the COMMITMENT table blocker = 1: CONTRATO COMPROMISSO codigos codgerado blocker 3315 1102 2 3317 1105 1 3318 1108 1 3320 3315 2 7726…
-
1
votes1
answer148
viewsInner Join returning duplicate lines
I have a purchase order table, which relates to the products table, The purchase order table can own multiple products, this consultation returns me all the purchase order, which has more than one…