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
answer92
viewsError while printing mysql data
Good afternoon! I am listing some mysql data using php; but when it is displayed in place of the words that are accented I see characters like these . My schema and table are configured with charset…
-
1
votes0
answers42
viewsChanging mysql_result to mysqli
I have a problem in the code that my teacher passed, I would like to change to mysqli, but I couldn’t get the mysql_result. Here’s the code he gave me, if anyone can help me, I’d appreciate it.…
-
1
votes1
answer99
viewsMysqli Prepare with Loop for Select
I’m trying to make a SELECT using MySQLi and PREPARE in a FOR but not working. Always returning a single zero. Application Code: if( $teste = $mysqli->prepare("SELECT COUNT(*) AS TOTAL_CONTATOS,…
-
1
votes1
answer1673
viewsPHP connection problems with Mysql.(Access denied for user)
I am a beginner in the area that refers to programming and computers. I have a problem that I can’t get the solution anywhere. I have a Linux virtual machine with a Mysql server to supply the Zabbix…
-
1
votes1
answer233
viewsError in MSQLI Insert
I am switching from mysql_to mysqli, everything works(update and delete) more on Insert not saved.... where is the error? Insert archive: include("config/con_mysqli.php"); $sigla =…
-
1
votes1
answer27
viewsnumber of variables does not match the mysqli parameters
Well I am trying to make a select "bindado" however this returning the following error Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of variables doesn’t match number of…
-
1
votes2
answers1450
viewsMysqli does not display results
I have the following table in the comic DUELOS , I entered the data but at the time of picking up the result I’m having problem what should be? data in table code that fetches the data $iddesafiante…
-
1
votes1
answer110
viewsError in "=" in mysqli_query
I have a problem in mysqli_query and I can’t find the error. I tried to make some changes I saw on the Internet and it didn’t do any good. I also tried to change the line that is file problem, but…
-
1
votes0
answers13
viewsPHP Warning: mysqli_fetch_array() expects Parameter 1 to be mysqli_result, null Given in
I’m having trouble making a query in the database. I’ve tried the same command in the database and it worked normally. Follow the code: $resultado = mysqli_query("SELECT * FROM usuario ORDER BY…
-
1
votes2
answers136
viewsPage does not receive and does not register data in Mysql
I’m mounting a php application for user registration, but for some reason when I input the data and click register, it reloads the page does not give any error, and does not load anything in the…
-
1
votes1
answer165
viewsDoubt about JPQL
I honestly have a certain difficulty with comics, and I need a JPQL that returns only one record. I have a Price entity and a Product entity. I need to bring the last registered price by the user. I…
-
1
votes2
answers45
viewsUpdate visits when opening the site
I am doing a function to change the count of visits on my site. The function is this: function visitas($conexao, $visita) { $query = "update visita set visitas= visitas + 1"; return…
-
1
votes1
answer287
viewsPass a php array in a query and return multiple results
I want to pass a dynamic POST array of type: array(2) { [0]=> string(1) "1" [1]=> string(1) "3" } For an SQL query where it returns multiple results depending on the string values in the array…
-
1
votes1
answer1001
viewstransform Mysql record into php variable and show in HTML?
I am asking to search in the database a result equal to a variable url that I already have, it looks right, but I want to pick another column in the same row of the url that it was looking for like…
-
1
votes1
answer23
viewsA logic in php
I am creating a system and I want to make sure that my user can only make five posts in the database, that is, on the site. What logic would I use to make this kind of permission? Grateful.
-
1
votes0
answers484
viewsPopular input fields with jquery
Good afternoon, I’m making a form where I type the customer name in an input tag, after filling the name it does the database search existing the name it fills the code field, document, this is ok…
-
1
votes1
answer130
viewsdata insertion in mysqli with php
Good morning guys, I’m having a problem inserting data in mysqli with php. I am using a form with 3 fields: name, email and password. The problem is that the data I enter in the email field will…
-
1
votes1
answer124
viewsphp - No update in Boolean field
I am trying to update the user data, but the active field is not updated. I have tried several changes and also change the variable value $active of boolean for int, but without success. Another…
-
1
votes1
answer438
views -
1
votes1
answer254
viewsHelp to convert mysql to mysqli
I’m a little layy in PHP and MYSQL and I’m having a need help problem to convert the MYSQL connection to MYSQLI follow the codes below: mysql.php <?php Class mysql { public $query; public…
-
1
votes2
answers15763
viewsHow to fix this Undefined Variable error?
I’ve been trying to figure this whole php but I’ve done everything and nothing works. (It’s a visitor control system) Follow my codes below. form-visitors(html in php). php <!DOCTYPE html>…
-
1
votes1
answer649
viewsQuery in very long delay tables? Mysql
I am developing a system that I hope to become great in the future and I have a dilemma: store an array in each user’s data or create a specific table with all this mixed information (Ex: each…
-
1
votes2
answers245
views -
1
votes3
answers3324
viewsRemoving Accents and Transforming Spaces into PHP strokes
I updated my PHP and my following Script which I used to transform the text without accents, and the spaces in strokes (-) no longer works in PHP due to the ereg_replace is obsolete. <?php…
-
1
votes1
answer117
viewsRetrieve dynamically generated checkbox values
I have a form that has some checkboxes with city names that are generated dynamically by PHP. I’d like to know how to get these values and what kind of structure to store them (Array?) and what kind…
-
1
votes1
answer330
viewsWhile returning duplicate data
Good morning Guys, I have this query $query = "SELECT p.*, c.nomeCategoria AS categoria FROM produto AS p INNER JOIN produto_categoria AS c"; $dados = mysqli_query($con, $query) or…
-
1
votes0
answers21
viewsHow to minimize mysql 4 to 5 migration issues
Good evening guys, I have a system that was developed last year for a client. The client hired a server and the staff installed mysql 5 on it. The problem now that I am is that int and date field…
-
1
votes0
answers907
viewsproblem storing accented characters
hello! my database is in utf8 and on all pages I put the following code: $con = mysqli_connect($_SG['servidor'], $_SG['usuario'], $_SG['senha'],$_SG['banco']); mysqli_query($con,"SET NAMES…
-
1
votes1
answer56
viewsUpdate record in table using Selected in MYSQL
I’ve got this problem I can’t seem to solve. I have the following tables in the database: And in the form he pulls the correct data, but now that I will update for example only the plate and do not…
-
1
votes1
answer52
viewssearch data in Mysql and php table
I have table A with id and user fields and table B with id, data and id_A; On the PHP page I want q to appear the contents of table B, and with id_A to find the name in table A. The main thing for…
-
1
votes1
answer76
viewsHow can I put an if in this mysql search when no results return?
how to put an if and Else in this code for when the search in the database does not return any value? include_once("conexao.php"); $sql= "SELECT FROM tb_nome WHERE nome LIKE '$pesquisar%'"; $salvar…
-
1
votes3
answers1926
viewsHow to put a php variable in a mysql query?
For example: $query = "INSERT INTO tabela (data, assunto, destino, elaborado) VALUES('{$data}', '{$assunto}', '{$destino}', '{$elaborado}')"; Where is tabela, i want to put a variable in place,…
-
1
votes1
answer3121
viewsCreate dynamic chart using mysql and Highcharts
Guys I’m trying to create a chart using Mysql and Highcharts on a Xampp local server. However, when running index.php only the source code of the page is displayed, not generating the chart. Below…
-
1
votes2
answers796
viewsHow do I view data from a specific line in a database without knowing which line it is?
Hello. I have a while that prints on the screen a list of all the names of the companies in my database: $sql = "SELECT `nomep` FROM `cadastropn` WHERE `cidade` = '$cidade'"; $result =…
-
1
votes2
answers165
viewsHow to do a double "Update" in Mysql
I am developing software in PHP/HTML/MYSQL FRONT. I need to update a table but change two columns at once. Here comes my doubt in the $gravaprat1 variable, because it is not executing the second…
-
1
votes1
answer5696
viewsAdding a foreign key to mysql
I’m still learning how to create tables in Mysql and I’m having some difficulty. If you were to create a table with your relationship, you would create: CREATE TABLE estilo ( codigo BIGINT(20)…
-
1
votes0
answers208
viewsmysqli_query() within mysqli_fetch_assoc() dispenses with the use of mysqli_free_result?
With the new Mysql class, mysqli, it has become necessary to worry about always making use of mysqli_free_result() after mysqli_query() with SELECT for memory release, but I often use mysqli_query()…
-
1
votes1
answer66
viewscalculating date in update mysql
Good need to update my accounts that are past due more than 5 months, I wanted to do this directly in mysql. The update is like this: UPDATE contas SET baixa_valivade = true WHERE data_vencimento…
-
1
votes2
answers386
viewsLast lastInsertId ID
Good afternoon Guys I’m trying to get the ID that was entered by my class but unsuccessfully. The examples I found none worked. If anyone can help, thank you. public function…
-
1
votes1
answer70
viewsCan you improve these 12 selects where only one parameter varies?
I have an online table with about 3 thousand records. I make twelve selects to list the results per month, ex: select count(campo) from tabela where extract(year from data) = 2016 and extract(month…
-
1
votes0
answers101
viewsReplace a name in all mysql database tables
Good morning. I need to replace a domain that is in several tables of the comic. That would be the correct form? SELECT REPLACE('*', 'velho.dominio.com', 'novo.dominio.com'); As there are many…
-
1
votes1
answer321
viewsError selecting database "Error in database Selected"
I was making a system of comments, but is giving error: Error in database Selected Code: <?php $link=mysqli_connect("127.0.0.1","root",""); $banco=mysqli_select_db($link,"bdcomentario"); ?>…
-
1
votes1
answer48
viewsHow would this PHP be converted to mysqli instead of mysql?
I need urgent the following PHP that was built in msql is written in mysqli it is part of an application in which I am developing I have no knowledge in PHP I’ve broken my head behind a conversion…
-
1
votes2
answers521
viewsMysqli with access denied even with correct settings
I’m making an unusual mistake for myself. Next: when I try to connect via mysqli I get error return on authentication ( access denied ), and the parameters are all correct! To confirm this access…
-
1
votes1
answer131
viewsQuery string works in Phpmyadmin and does not work in PHP
I have the following query that picks up a date, was tested on phpmyadmin and the Heidisql program successfully: Query Mysql set @rn:=0,@grp:=0,@prevdate:=''; from (select DataEncomenda, @rn:=@rn+1…
-
1
votes1
answer132
viewsswitch case to work when migrating from PHP 5.6 to 7.0
I have a news system running with PHP 5.3 and would like to upgrade it to at least 5.6. I have been using Php_codesniffer-master and Phpcompatibility-master to assist me in the change. Most of the…
-
1
votes1
answer42
viewsWhat method do I use to mark a BD search result checkbox in ajax?
I need to mark checkboxs for a page of editing forms, the values are saved in a table where checkboxs that were marked in the register were stored, but I do not know how to pull these results and…
-
1
votes1
answer78
viewsSend values to the database
You can help me send the values of the fields to the database. For the viewer, I’m using the following code: Page code: <?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>…
-
1
votes3
answers1052
viewsHow to select different records between two tables
How to select different records between two tables I tried to run the query with the query below; but it did not generate records; SELECT c1.cod_coletor, c2.cod_coletor FROM item_inventarios c1…
-
1
votes1
answer985
viewsmysqli_query() expects Parameter 1 to be mysqli, null Given in, how to resolve?
I want to enter the values of the form in the database, but shows the error. mysqli_query() expects Parameter 1 to be mysqli, null Given in Php link code: <?php include_once('_php/conn.php'); if…