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
answers13
viewsMysql trigger does not identify fields
good night, I have a Trigger in Mysql, but it doesn’t work, it just calls a precedent by passing a value. It doesn’t generate an error, but it doesn’t work. Trigger code: delimiter $$ create trigger…
mysqliasked 3 years, 10 months ago Alan Ismael 11 -
1
votes0
answers48
viewsPass page via $_GET and manipulating the URL via . htacess
I have a page in PHP that shows the products in general (products.php): <?php include_once("conexao.php"); $query = "SELECT * FROM produtos"; $result_query = mysqli_query($conn, $query); ?>…
-
1
votes0
answers24
viewsProblem: User-friendly URL on . htacess modifying the Index
As I explained in the post: /questions/491299/passar-p%C3%a1gina-via-get-e-manipulating-a-url-via-htacess I have a structure of pages: 1-Index 2-Product 3-Detail (of products) The 'Product' page is…
-
1
votes1
answer38
viewsI need to show a dataset in MYSQL
Need to pull the amount of matches played, amount of goals scored, create an average goal per match (average goals = Number of matches / Number of goals) all in one View, I did the VIEW but always…
-
0
votes1
answer127
viewsRegistration in the BD with pre-filled fields
I’m creating a system of registration on top of a system I found on the Net. In my system there are only 2 fields e-mail and password, and the password will already be pre-registered, missing so…
-
0
votes2
answers479
viewsI cannot insert in related tables
I am in trouble. I normally insert in the table "equipment" of my code and normally populate the mysql BD. However, the table "dell" is empty, even passing the reference of the ID of the table…
-
0
votes2
answers687
views$_Session variable does not write to database
I’m using mysqli and I can’t save information in the database. I ran the test with echo var_dump($_SESSION); echo "<br />"; echo $_SESSION['login']; The value returned was: array(2) {…
-
0
votes2
answers184
views -
0
votes1
answer172
viewsError in row mysql_fetch_array
This is an information seeker from universities, my TCC. This is the mistake: $mysqlli = new mysqli($servidor,$user,$senha,$banco); if(mysqli_connect_errno()) trigger_error(mysqli_connect_error());…
-
0
votes3
answers3581
viewsWhat is the equivalent of mysql_result in mysqli?
How can I make a FOR in php using mysqli? 'Cause I’ve always been able to do that: for($i=0; $i < $qtde; $i++){ $pet_id = **mysql_result**($dadosPets, $i, 'animal_id'); } How do I do the same,…
-
0
votes1
answer479
viewsPredict next Bank ID
Good staff I’m wanting to better organize the images of the posts but for that I need to know what will be the next ID so I check the image first before entering the rest of the data. if…
-
0
votes2
answers230
viewsSearch with date range
In Mysql I have a table that has two DATE fields: data_inicial and data_final. In the System I have a Field (Textfield) where I type a date. This date does not need to be precise, but corresponds to…
-
0
votes0
answers176
viewsview list of returned items in json format with php and mysql
I am developing a website for a real estate, at the moment I am listing the properties and paging the result with sql queries, are listed more than 2000 properties and there is a significant delay…
-
0
votes2
answers170
viewsWhile isn’t stopping when he should
I have the following code: <div class="row"> <? $tag = mysqli_real_escape_string($connection,$_GET['categoria']); $result = $connection -> query("select * from produtos where tags like…
-
0
votes2
answers2308
viewsDynamic form? how to do?
I have the following question, I have one while in PHP, and in this while have a form and a button of Submit who sends this form, but as there are several records he repeats this form and the system…
-
0
votes2
answers109
viewsError in SQL syntax - mysqli_real_escape_string
I have a syntax error in my code, but I can’t find my error. That’s the mistake I’m getting: You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for…
-
0
votes0
answers52
viewsTrying to display Rand() after inserting in db
Hello, I’m trying to display a random number with Rand() after inserting it into the database. mysql insertion works normally, but when I try to display a message with the $request variable nothing…
-
0
votes1
answer889
viewsCatch field on table with Mysqli
I am trying to create in my code a comparison to check if the password entered is equal to registered. I used it as follows; function confirmaPedido ($conexao, $numeroPedido, $senha) { $querySenha =…
-
0
votes1
answer67
viewsComment for each post id without multiplication of the same
First see the image of my database (the link arrows from one table to another are the inner join's): http://prntscr.com/6wjl4h Current query: "SELECT question.*, questioncomments.*, login.* FROM…
-
0
votes1
answer469
viewsI created a registration system using PHP+Mysql then when running asks to replace Mysql with Mysqli... Which ones should I replace?
<?php $host = "localhost"; $user = "root"; $pass = ""; $banco = "dbcadastro"; $conexao = mysql_connect($host, $user, $pass) or die (mysql_error()); mysql_select_db($banco) or die (mysql_error());…
-
0
votes2
answers838
viewsHow to create a button if you are logged in to an account
Hello, I wonder when someone is logged in to create a FILE type button. The registration and login system is created, but I do not know how to know when it is logged in or not. index php.…
-
0
votes1
answer786
viewsI need to change the onclick button to angular.js
Good evening. I’m using Bootstrap paging with Angular.js . I can get the database data and list it, it was beautiful, etc... the way I needed it. However, I need to open a modal window and it worked…
-
0
votes1
answer72
viewsFatal error in login system
I am making a login system in PHP and resulted in a fatal error: Fatal error: Call to a Member Function num_rows() on a non-object in C: xampp htdocs avulso-2 valida-usuario.php on line 10 <?php…
-
0
votes1
answer61
viewsMysqli prepared sentences
Hello, I have a problem, I would like to know about prepared sentences, I have this code: $query_email = ("SELECT email FROM usuarios_ WHERE email = ?"); $stmt = mysqli_stmt_init($conn); if…
-
0
votes1
answer221
viewsMVC connection, which one to use Msqli or PDO?
I’m starting to program a PHP MVC, which type of connection is most recommended: Msqli or PDO and why?
-
0
votes1
answer570
viewsThe form does not send data to the database
I created a discussion topics registration form. Discussion topics are linked to a category via a foreign key. Then, if I click on a category, a list of topics appears. What I want is to be able to…
-
0
votes1
answer28
viewsQuestion about "->"
Good morning, I have the following code snippet: $sql = "SELECT * FROM users WHERE user_name = '" . $user_name . "' OR user_email = '" . $user_email . "';"; $query_check_user_name =…
-
0
votes1
answer48
viewsCreate a Three Table Viewer
How to create a view in mysql with 3 tables being the following structure cliente |id_cliente |nome_cliente produto |id_produto |nome_produto |valor_produto pedido |id_pedido |id_produto |id_cliente…
-
0
votes2
answers649
viewsPHP and Mysql: Database does not update
Good afternoon everyone, I’m making a screen for editing personal information. My code to capture the typed data is this: <?php require("../config/functions.php");…
-
0
votes2
answers134
viewsSelect in table records with Mxn relation
Hello, I have in my bank a table tb_usuario (id INT, name VARCHAR, flag_active INT) and a table tb_regional(id INT, name VARCHAR,login VARCHAR, password VARCHAR). From the relationship between the…
-
0
votes1
answer63
viewsI want example of why replacing ' with '' and for parameters of a query is dangerous
I see many posts on this subject, but I do not see any example that has fit for this my case. function sanitize($value) { $val = str_replace("'", "''", $value); $val = str_replace("\\", "\\\\",…
-
0
votes0
answers205
viewsWhen trying to insert something into the bank with boolen error mysqli
Shows this error: Uncaught Error: Call to a member function bind_param() on boolean in /opt/lampp/htdocs/sala/class/Config.class.php:35 In my file it’s like this: public function Cadastrar(string…
-
0
votes1
answer131
viewsHow to Insert with values posted in textarea
I would like to know how I can make use of textarea together with php and mysqli to do the following need to send 12 items within a textarea and that these items are put with line break and that…
-
0
votes1
answer83
viewsHow to pass an array value in bind_param in mysqli?
I am doing so, but always error because of array, someone knows how to solve it: public function Verificar(string $tabela,string $parametros,array ...$usuario) { $this->Query =…
-
0
votes1
answer209
viewsScroll down when you receive new PHP MYSQL AJAX JAVASCRIPT message
I’ve been searching for about 4 days on how to scroll my chat scroll when I receive new messages and scroll up to see previous messages. I made a script using setInterval, but when I try to roll the…
-
0
votes0
answers210
viewsshow similar product/property with php and mysql
I am developing a feature on my site to show similar properties by title and value 9r, but it did not work very well my idea: <?php //Armazeno o resultado do titulo da consulta anterior da tabela…
-
0
votes0
answers37
viewsassign rows in a column to different variables
Good afternoon, I’m beginner in php and wanted help with a code. I made a query that selects a column and limits 6 lines in descending order, the query worked all right, but I’m having difficulty to…
-
0
votes1
answer147
viewsDelay in massive processing of ajax Codeigniter
My code imports data from one database to another. To avoid server overload, I am importing 100 out of 100 records into each ajax. I noticed that in the first requisitions, it takes about 40ms,…
-
0
votes2
answers102
viewstrying to connect with mysqli
I’m trying to connect to the database via myqli with php but I’m not getting it. Follow the code: <html> <head> <title>sistema de cadastro</title> </head> <body>…
-
0
votes2
answers130
viewsError with AUTO_INCREMENT ID
My problem is to leave the first INSERT field empty,(if I fill the program runs), in my phpmyadmin the ID field is AUTO_INCREMENT, but without modifying that part of the code, it stopped. Code: $sql…
-
0
votes0
answers26
viewsHow do I login and enter a user profile?
I have my user registration system and the login in which a command searches the records of login and should return the entry to the respective user profile. In this part I was left aimless. I…
-
0
votes2
answers1126
viewsPassword encryption on MD5?
What security does the MD5 bring if the encryption of a password is only in the database in the password field? If by chance the system is invaded by which want another breach MD5 would influence…
-
0
votes1
answer309
viewsmysqli: Couldn’t fetch mysqli_result
I want to save the result of a query in $_SESSION, but when I try to retrieve the $_SESSION, wrong "Couldn’t fetch mysqli_result". Note: I use the session_start(). Follows the code: Query mysql:…
-
0
votes1
answer156
viewsError Creating mysqli connection
I’m trying to create a connection by MYSQLI but this giving error Fatal error: Call to Undefined Function mysqli_connect() in /home What could that be? That $link = mysqli_connect("localhost", "xx",…
-
0
votes1
answer600
viewsInsert various data into a mysql column
Good afternoon Guys, I’m cracking my head open about how I make this insert in the bank, it’s kind of like this... I have a product, which needs to be priced more than one supplier, to compare…
-
0
votes0
answers27
viewsLoad pins selectively via Mysql - Maps API
I have a question about loading pins from a Mysql database. Let’s say I have a database that stores multiple latitudes and longitudes and needs to load some pins from them, via the Gmaps API.…
-
0
votes0
answers1275
viewsHow to use Inner Join in php?
Can someone help me? I have the following problem: I have 2 tables and in these 2 tables I have the names, and in the course table I have nome and in the category table I also have the field nome.…
-
0
votes1
answer1682
viewsCan you "hide" the password that goes in mysqli_connect?
$server = exemplo.com; $user = root; $senha = 123; $conexao = msqli_connect($server, $user, $senha); I know the php page is not visible to the user, but nowadays, you cannot underestimate Cracker.…
-
0
votes1
answer51
viewsQuery for Search Field
I need to make a query to search all records that have the term typed in a input, for example: Car, be returned blue car, green car, etc... My query current: $query = "SELECT * FROM veiculos WHERE…
-
0
votes0
answers38
viewsWhich is safer PDO or mysqli_*?
I was reading and I saw that many say, PDO merely simulates the prepared statements and consider a disadvantage, I wonder then... Which is safer? Or which is more susceptible to SQL Injection or any…