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
answer59
viewsCreate current month searching array
I’m creating a list of birthday students of the month, using php and mysqli. I’m not only able to load the birthday students of the current month,; SELECT * FROM `student` WHERE…
-
-1
votes2
answers266
viewsHow to store the values of a phpMyAdmin table in a variable/array/array and use it in Arduino code?
My school work consists of a basic security system using card frequencies, in a similar way to buses: passes card in the reader, if the frequency is X releases the ratchet, if it is non-X the…
-
-1
votes1
answer27
viewsChange database information via PHP
I made two files in order to alter the information of an item with a specific id, the code works correctly, but the information is not changed. Can you help me? Follow below the codes: edit.php:…
-
-1
votes1
answer1038
viewsError connecting to bank!
I made a page to register information of a student in the mysql database, but when sending the form data, it returns these errors: Notice: Undefined variable: mysqli in C: xampp htdocs Easytec…
-
-1
votes1
answer35
viewshtml and mysql special characters
People I have video registration system via IFRAME but when I want to show the iframe it is empty because the database converted Original iframe code…
-
-1
votes1
answer101
viewsError "Warning: mysqli_real_escape_string() expects Parameter 2 "
I am creating a webservice that will have to pick up some. pdf files saved in the database and send to a user x. To save this file in the bank, I’m trying to do it this way: <?php…
-
-1
votes1
answer26
viewsfile sends to folder but does not send data to database
I skipped a site to a server, making all the necessary settings, I have gallery control that has an upload file that sends the data to the folder and the information to the bank, nothing out of the…
-
-1
votes1
answer52
viewsPHP/Mpdf - Display all mysqli field results
I’m trying to display all the results of a field in mysqli via php, and display in mpd, but it’s only returning 1 line, can anyone help me please ? <?php session_start(); require_once __DIR__ .…
-
-1
votes1
answer26
viewsMysqli lastinsertid for PDO
I have an insert page, as soon as I click insert new accommodation, the system should insert some ready data, but on the same page I need to recover the last id, so that I can complete the other…
-
-1
votes1
answer57
viewsSuccessful php registration response
I’m trying to make a return "Registration made successfully" but always falls in Else, he is not counting the number of lines. public function adicionarAluno(string $nome, string $matricula, string…
-
-1
votes2
answers49
viewsI’m having problems with my login system
<?php include('conexao.php'); if(empty($_POST['usuario']) || empty($_POST['senha'])) { header('Location: index.html'); exit(); } $usuario = mysqli_real_escape_string($conexao, $_POST['usuario']);…
-
-1
votes1
answer82
viewsPHP and Mysql Text Pagination
I have a large text with many characters and I need to make it stay in 5 pages with option NEXT PAGE and PREVIOUS PAGE. I searched and I can not find any tutorial on the subject, someone can help…
-
-1
votes1
answer79
viewsReturn of several CASE in a single line
How do I convert that return: In a single line: 548721 125 2 20836 20836 77821 77821 9999******9999 0 0 MASTERCARD 200 Cartao de Credito a Vista My query: SELECT CASE data_id WHEN 17 THEN data_value…
-
-1
votes1
answer77
viewsERROR WHILE UPLOADING Laravel
Sirs, I am having the following error "The "/tmp/php63F4kk" file does not exist or is not readable." in Laravel, I am entering the information as follows: if($request->hasfile('foto')) { $image =…
-
-1
votes2
answers325
viewsAdd records from a field and display in PHP (values have R$ in front)
Hello, I’m trying to sum up some values using the SUM and is returning 0. The fields I will use: category month value (want to add this) I want to add the valor of all records of each category and…
-
-1
votes1
answer181
viewsphp does not recognize the mysqli_connect() command
I am running a coigo via cmd and he started to present this error PHP Fatal error: Uncaught Error: Call to Undefined Function mysqli_connect() in…
-
-1
votes2
answers38
viewsI need to convert to current PHP
I have an old form that would like to adjust a page with current PHP parameters. Follows code: <?php include "login_senha.php"; $email = $_POST['email']; $sql = mysql_query("SELECT * FROM…
-
-1
votes1
answer692
viewsHow to display saved images in the bank?
I can’t display the photos I’m sending to the database. I’m making a e-commerce photo and managed to send them to the database (Mysql). I created my database, then my table. I made the connection…
-
-1
votes1
answer155
viewsPHP Mysql multidimensional array
I’m having a little trouble assigning an index to encompass the items marked in the figure below in a multidimensional array I’m mounting with the database queries: I need to take from another table…
-
-1
votes1
answer37
viewsAdd values from a column in the table
I need to select the 3 users with the highest revenue. Before in the table cde_usuario there was a column called scythe, being very simple to make this query, used this sql: $sql = "SELECT * FROM…
-
-1
votes1
answer20
viewsNot bringing the data with multiple filters into a table mysqli
<?php $query = "SELECT * from SALDO_GERAL"; $i = 0; $selectedOptionCount = count($_POST['LOCAL']); $selectedOptionCount2 =…
-
-1
votes1
answer37
viewsImplode is not working right
I’m using this code include_once('../conexao.php'); $query = "SELECT titulo FROM info"; $result = mysqli_query($conexao, $query); $titulo = mysqli_fetch_assoc($result); <input type="text"…
-
-1
votes1
answer520
viewsmy code is giving "error in Count(): Parameter must be an array or an Object that Implements Countable in"
the two files that make connection and that: <?php include("classe/conexao.php"); if(isset($_POST['confirmar'])){ //1- Registro dos dados if(!isset($_SESSION)) session_start(); foreach($_POST as…
-
-1
votes1
answer42
viewsHow to recover ID in JQUERY
The goal is popular a select according to the previous select. Script <script> $(function () { $('#adms_grps_prod').change(function () { if ($(this).val()) { $('#adms_tps_prod').hide();…
-
-1
votes1
answer24
viewsinput with jquery sends value, but php does not query in BD any dirty?
<script> jQuery(function($){ $('#busca-cid').submit(function(){ $.post('lista-cidades.php', $('#busca-cid input'), function(retorna){ …
-
-1
votes1
answer26
viewsMYSQL how to query in 2 tables where the query may or may not exist in one of the tables?
Good people!! I’m new around here, I need your help. I need to create a table/query where the records made by the user returns. This user may or may not be part of a working group, where several…
-
-1
votes1
answer43
viewsShow records, via PHP and Mysql query, in two tables, with GROUP BY
Good evening... I have the following doubts This system aims to bring users from a particular region or workplaces that belonged to a particular city. If we search for city=4261, according to the…
-
-1
votes1
answer34
viewsList table values randomly with RAND() or ARRAY for a Captcha
I’m creating a CAPTCHA and for that I made a table with alternatives that the user will have to select the IMAGE correct. First I draw a word. Example: You must select the word FAN And then I put…
-
-1
votes1
answer27
viewsCopy id with 2 Insert
Well I have two INSERT in the same file, and I want the id of the first INSERT(Tabela1) also go to my second INSERT(table2), I really do not know how to do, I will leave everything more detailed…
-
-1
votes1
answer18
viewsRelate the indices (keys) of an obejto Array to the indices (keys) of an array (PHP)
I have a question where I could not find a solution. I have an Array object values and an array status, where I want to relate the indexes of the Array object values to the indices of the array…
-
-2
votes1
answer155
viewsQuery calculating dates with INNER JOIN
Personal hail, Here there’s an example that a guy here from the community posted and I’m trying to adapt my needs but an error arises: #1248 - Every derived table must have its own alias My query…
-
-2
votes2
answers76
viewsProblem with bank call for listing
Good evening, I am developing a system of hours, but I was barred by a connection problem so I could do the listing of my database on the screen... When I update the page it presents me two errors:…
-
-2
votes1
answer385
viewsSearch by filter using mysql
Hello! I need a search with filter relative to product page by category, that is, when looking for products by a certain category show in the sidebar filter options such as: new or used, minimum…
-
-2
votes1
answer740
viewsDelete table record with foreign key
Where is the Error? DELETE FROM postagens WHERE id='$p_id' AND u_id='$u_id' SET FOREIGN_KEY_CHECKS = 0; Clarifications: p_id = id of posts(primary key) u_id = user id(foreign key)…
-
-2
votes1
answer79
viewsI can’t enter data numbers float
<?php require_once('cabecalho.php'); require_once('conn.php'); ?> <?php $nome = $_REQUEST["nome"]; $preco = $_REQUEST["preco"]; $query = "insert into…
-
-2
votes1
answer51
viewsContinue searching in Mysql after given ID
Good night, I would like to know how to continue a search in Mysql, through PHP ($mysqli->query()), example I performed a search and found a user ID 1584, and I want to search another, but…
-
-2
votes2
answers88
viewsSubstr() does not work
I cannot understand why the substr is not working. Follow the code: <?php // conexão com bd $host = "localhost"; $user = "root"; $pass = ""; $db = "loja"; $conexao = mysqli_connect($host, $user,…
-
-2
votes1
answer52
viewsHow to call a connection within a function?
<?php define('HOST', 'localhost'); define('USER', 'root'); define('PASS', ''); define('DBNAME', 'soufood'); try { $conn = new PDO('mysql:host='.HOST.';dbname='.DBNAME.';',USER, PASS);…
-
-2
votes2
answers581
viewsHow to pass python variable to sql query?
I am using Mysql as a database. I wanted to be able to pass the value of a python variable as a parameter in this query. Ex: cursor = connection.cursor() variavel_nome_cliente = input('Digite aqui o…
-
-2
votes1
answer57
viewswhere do I use left Join in this case? no msql
I need to put the left join in which case here you can tell me where the mistake is? select a.nome_artista, count(*) as numero_musicas from artista a, musica m where m.id_artista = a.id_artista…
-
-2
votes4
answers4554
viewsGROUP BY and ORDER BY Mysql
When I send the Query: SELECT * FROM tabela WHERE id_cliente = '$id_cliente' ORDER BY ano DESC Duplicated values are returned because there are duplicate values in the table. But I want to return…
-
-2
votes2
answers105
viewsphp array for json will not all data
Hi, I’m having a problem with my code and I wanted your help. I need to take data from a table and send it as json, I have 10 items in my table but json only sends one. Table: local In my code where…
-
-2
votes2
answers3654
viewsHow to resolve "Function name must be a string" error?
Fatal error: Uncaught Error: Function name must be a string in C: xampp htdocs Proj_solos php login.php:11 Stack trace: #0 {main} thrown in C: xampp htdocs Proj_solos php login.php on line 11…
-
-2
votes2
answers297
viewsMysqli_fetch_array in Locaweb, error logging in!
Hello, I have the following code: <?php session_start(); require_once('conecta.php'); $email = sha1($_POST['email']); $senha = $_POST['senha']; $sql = "SELECT * FROM dados WHERE email = '$email'…
-
-2
votes1
answer69
viewsScript "more beautiful"
I am using the following code for the User class : <?php class Usuario { public $nome, $email; private $senha; private $mysqli; public function __construct($nome, $email, $senha){ $this->nome…
-
-2
votes1
answer60
viewsHow to make condition with msql number
Personal need a lot of help I have an input for the person to make a money transfer but if that person has 30 real money and she type a value of 100 real to make the transfer she will be with…
-
-2
votes1
answer155
viewsWhy is my foreach duplicating my database records?
function DBRead($table, $params = null, $fields = '*'){ $table = DB_PREFIX.'_'.$table; $params = ($params) ? " {$params}" : null; $query = "SELECT {$fields} FROM {$table}{$params}"; $result =…
-
-2
votes1
answer440
viewsGenerate sequential numbers for draw
I am creating an online draw system in PHP and Mysql. First I create the draw where I inform the prize and its details, among them the amount of coupons, beginning at a specific number. To put it…
-
-2
votes2
answers120
viewsConnection to a Database
I’m having a problem connecting to the Mysqli database, is making several mistakes, follow the mistakes below: PHP Warning: mysqli_query() expects parameter 1 to be mysqli, null given in…
-
-2
votes1
answer156
viewsValidate PHP URL for sending to Database
Guys I have this code that does the processing, however I wanted to add a url validator, I tried to insert if ( ( ! isset( $site ) || ! filter_var( $site, FILTER_VALIDATE_URL ) ) && !$erro )…