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
-
0
votes1
answer236
viewsHow to list Rows <table> values
How can I list column values in a "<table>" ? I want to list all Rows values in <tr> as shown in the image Table code: <table id="datatable" class="table table-striped table-bordered"…
-
0
votes2
answers72
viewsShow first and last record of each date
I would like to search the database for all records according to the "DOCTOR" between two dates DATA_INICIAL and DATA_FINAL No repeat records of the day. CURRENT RESULT: BRUNO BARBOSAS 02/04/2018…
-
0
votes3
answers1316
viewsReturn of PHP Query in Ajax
How do I get the PHP query values in AJAX? AJAX $.ajax({ type: 'post', dataType: 'json', url: 'listaGabaritosSelecionados.php', success: function(url){ $('.retorno').html(url); } }); PHP $mysqli =…
-
0
votes1
answer60
viewsBring multiple values from a Join in mysql
Guys, I have a question about a mysql query using the Codeigniter Framework. I have the following tables: Table Products |--------|-----------------| | id | nome_produto |…
-
0
votes1
answer114
viewsSort query by Mysqli relevance
how the query below could be ordered by relevance and then by date? $query = $mysqli->prepare( "SELECT `id`, `titulo`, `foto`, `descricao`, `slug`, `data`, '' as `local` FROM `noticias` WHERE…
-
0
votes1
answer69
viewsProblem with LEFT JOIN in PHP
Hello, my friends. I have 3 tables in my mysqli bank to record access to a particular location: visitor, whose data will always be filled in. corporate, whose data will be filled in only if the…
-
0
votes1
answer62
viewsMultiple queries and then sort those results in order to appear in order by date
I need to do N consultations according to a value received from another consultation. $idList = array(); if (@$_GET["page"] == "profile"){ $idList[0] = $_GET['pid']; $cont = 0; } else { $idList[0] =…
-
0
votes1
answer65
viewsHow to make a page accessible only to users at a certain level
Good morning, I have a login system with php and mysql, in the database I have 2 users, one has Admin level (0) and the other Master (1), I have the login page that asks the person’s Username and…
-
0
votes1
answer403
viewsPhp post approval system
I am creating an approval system of posts middle in "Gambiarra", what I did is, when the user makes a post, it receives the value '0' in the table 'Status' in the database. So, I have a restricted…
-
0
votes1
answer71
viewsPass mysql class to mysqli error in query
I have a problem to pass the consultation (this->Query($sql)) and the rest to mysqli. I don’t know how to proceed MISTAKES: PHP Warning: mysqli_query() expects Parameter 1 to be mysqli, null…
-
0
votes0
answers11
viewserror editing data from a PHP page to Mysql table
Because when I try to edit in a table in Mysql and the amount of lenghts is high, the program does not let edit? Ex: I gave a var_dump in the edit query... These are only fields: id, title, txt1,…
-
0
votes0
answers29
viewsPdo code help for mysqli
Code ok ! -:PDO:- correct code working header('Content-type: application/json; charset=UTF-8'); $response = array(); if ($_POST['delete']) { require_once 'dbconfig.php'; $pid =…
-
0
votes1
answer41
viewsHow to insert a keyword into a database search already performed
For example, I did a search of all user data in the database to echo in different columns by the site: $stmt = $conexao->prepare("SELECT * FROM esc_usuarios WHERE usu_codigo = ?");…
-
0
votes2
answers811
views"Illegal string offset" error when calling usort in database data
I am trying to sort the result by a specific column of a database array. function cmp($a, $b) { return strcmp($a['usu_codigo'], $b['usu_codigo']); }; usort($usu_info_coluna, "cmp"); Giving a…
-
0
votes1
answer53
viewscalculation with BD data, bring service, value and total
I need to save cliente, serviço, valor of a service. The first problem is to be able to return the total value (the sum of the services). Man form until the moment is like this: <form…
-
0
votes1
answer225
viewsErrors in mysqli, expected parameters
The following errors are appearing: Warning: mysqli_query() expects at least 2 Parameters, 1 Given in C: xampp htdocs rede profile.php on line 25 Warning: mysqli_fetch_assoc() expects Parameter 1 to…
-
0
votes2
answers905
viewsShow success message without leaving the page
I have a form that sends some data to the database and uploads it to an FTP, the bank part has a if which returns the error in a variable and shows the error in the form itself. But my question is…
-
0
votes1
answer284
viewsPHP Mysql error - mysql_num_rows()
I’m having trouble correcting this error, I don’t know much about language (almost anything). The error that appears on the page is this: Warning: mysql_num_rows() expects parameter 1 to be…
-
0
votes0
answers120
viewsSearch via GET does not return results correctly
I’m having a problem with a GET search. I have the following code: <?php //envio o charset para evitar problemas com acentos header("Content-Type: text/html; charset=UTF-8"); include_once…
-
0
votes0
answers49
viewsError when registering data in the database :(
I am trying to make a system of registration of companies, but it does not work. I am doing everything right to my view. The bank is the same, the variables are right and the functions are right. I…
-
0
votes2
answers48
viewsConnect form with database
I have Database called form, and a single table n_agreements. i need to display form information in a table. I’m unable to connect to database. <?php $conn =…
-
0
votes2
answers90
viewsError when registering form in database
I have the following resolution, I am not able to register in the bank. I already changed some things but always appears these errors: Warning: mysqli_set_charset() expects parameter 1 to be mysqli,…
-
0
votes1
answer95
viewsWhen registering user, I need to check in the database if this user already exists and present error message
It follows below my code. It does everything, but hangs on the "user already registered" message even if I insert a different user into the field! Remarks: $con is the connection to the database…
-
0
votes2
answers82
viewsDatabase returning no value
I have the following code: $sql="SELECT * FROM imoveis WHERE (suite LIKE '%".$suites."%' OR banheiro LIKE '%".$banheiro."%' OR quarto LIKE '%".$quarto."%' OR garagem LIKE '%".$garagens."%') AND…
-
0
votes2
answers50
viewsRmysql - My querys return a list
Hi, I’m working with a database that I usually access with Workbench. To start importing directly into R, I am using the Rmysql library. I can make the connection and find my tables, but when it…
-
0
votes1
answer102
viewsMYSQL connection error on Android using php
I’m trying to connect my Android Java application via php with my MYSQL database and insert data in it, but despite the Android application report that the "user was successfully registered" the…
-
0
votes1
answer46
viewsHow to make the result of a column?
if(($resultado_usuario) AND ($resultado_usuario->num_rows != 0)){ ?> <style> tr:nth-child(even) {background: #CCC} tr:nth-child(odd) {background: #CCC} </style> <table…
-
0
votes2
answers340
viewsHow to place an image inside echo and not show if it is empty
I made the code to show only if you have image, but it also shows the body of empty, it says in the source code of the page that my PHP is a comment as shown in the image below. And the code is…
-
0
votes0
answers41
viewsError submitting a form. Field of type "select" is not being sent. The <form> tag closes alone, before the end of the form
When submitting a "form" with php, the "option" of my "select" is not being sent. I tried via GET and via POST and was unsuccessful. I checked in inspect and the tag "form" is closing alone, before…
-
0
votes1
answer53
viewsDoubt how to mount a query in Mysql
SELECT `tab_banco`.`nome` AS `bancoNome`, `conta_bancaria`.`conta_apelido` AS `contaApelido`, `conta_bancaria`.`id` AS `idConta`, `movimento`.`conta_bancaria_id` AS `conta_bancaria_id`,…
-
0
votes1
answer23
viewsError with mysqli and Ajax data
I’m having a problem fetching data using ajax. <script> //função buscar dados function buscarDados(id) { $(function () { $.ajax({ url: 'ajax/dados_aluno.php', type: 'POST', data: {id: id},…
-
0
votes1
answer126
viewsError updating PHP script to new version (Mysqli)
This script is used together with Coppermine Gallery to show the last albums created in the gallery. However, it does not seem to work with PHP 7. When strings are kept in the old format…
-
0
votes1
answer34
viewsReturn last result (updated by date) of each attribute
I have a database with a table called config. In it I have the columns atributo, valor and data: atributo valor data_atualizacao juros_composto | 5 | 2019-01-25 juros_fixo | 6 | 2019-01-27…
-
0
votes2
answers307
viewsMysql - Query in related tables
The scenario is simple, SQL displays all the criteria results and there is a filter to select multi values that will be passed to SQL, which should refer to tbl2 in the field tbl2_criterio, and thus…
-
0
votes3
answers50
viewsCount data from a table to sum
Hello folks I’m crando a Dashboard and I came across a challenge and I don’t know what to do. Table Order of Services Nome_do_profissional = Susana Serviço = MegaHair Valor = 80 I need to create a…
-
0
votes2
answers78
viewsDisplay next table id in a form input
I need to display the next id number in an input, in case the form would be for a new sale, then I need it to appear in an input where it says the current sale number q will be made, in case the…
-
0
votes1
answer49
viewsHelp! PHP + Mysql import
I need some help, I created an import code for XML to the MYSQL via PHP. Follows code: <?php if (!isset($seg)) { exit; } //$dados = $_FILES['arquivo']; if (!empty($_FILES['arquivo']['tmp_name']))…
-
0
votes1
answer70
viewsConvert time obtained by the database from ("Y-m-d H:i:s"); to ("Y-m-d-H-i-s");
In this case how I can convert without using the method DATE_FORMAT(data_access, '%Y-%m-%d-%H-%i-%s') in SELECT <?php $resul_ult_aces = "SELECT as data_acesso FROM adms_ultimos_acessos WHERE…
-
0
votes1
answer98
viewsLong-running PHP script not completing until the end
I have the following code: <?php set_time_limit(0); ignore_user_abort(1); ini_set('memory_limit', -1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); /* CONECTION */ $conn =…
-
0
votes1
answer62
viewsHow to pass checkbox data through FILTER_SANITIZE in PHP?
I’m not getting past the values of checkbox in PHP. I have a single file home.php with the following code: <?php session_start(); ob_start(); include_once("conexao.php"); $btnCadastrar =…
-
0
votes1
answer66
viewsLoad checkbox explodes
I made a code with explode to carry checkbox of banco, however, it is only loading when it contains data in the exact order of variables, for example 'Theater 1, Theater 2' carries, but 'Theater 1,…
-
0
votes1
answer18
viewsMysqli_stmt Errors
Hello, I have this code <?php // Include config file require_once "../extras/config.php"; // Define variables and initialize with empty values $grupo = $cliente = ""; $grupo_err = $cliente_err =…
-
0
votes1
answer647
viewsPHP/Mysql Undefined variable in code
I’m trying to run this php code, but it reports me an error "Notice: Undefined variable: num_row in C: wamp64 www balance login.php on line 63" The variable was created on line 23 but it still…
-
0
votes1
answer50
viewsUpdate via POST showing error
Good evening, I’m starting to use mysql and I have a problem. I can access all the information from my database by making queries, entering data and everything else, but when it comes time to give…
-
0
votes1
answer201
viewsError Mysql PHP connection
Good evening, everyone, I am trying to connect my wordpress application to the remote database, so I can list users within the application. I already tested some things between some researches, but…
-
0
votes1
answer37
viewsProblem when trying to display data in a table - php
I’m having a problem trying to show nproposta, information on the application and dataregistada. Thanks in advance for any help. Thank you <?php…
-
0
votes1
answer151
viewsMysqli not found in Docker image
I uploaded a PHP application with mysql through docker-compose.yml: version: '3' volumes: data: services: db: image: mysql:5.6 restart: always ports: - '3306:3306' volumes: - data:/var/lib/mysql…
-
0
votes1
answer295
viewsclass mysqli is not found
PHP is giving the following error: Fatal error: Uncaught Error: Class 'loja\model\mysqli' not found in, he is not finding the mysqli class, but I have checked php.ini and it is not commented. I am…
-
0
votes0
answers153
viewsWarning: mysqli_real_escape_string() expects Parameter 1 to be mysqli
I migrated the site from Ocaweb to hostgator and php are in different versions. Now I need to use mysqli. I’ve already arranged the /public_html/.../mysql.php. Now this file:…
-
0
votes2
answers198
viewsDisplay Welcome Screen with User Name in PHP page
Good afternoon. I’m trying to implement on a page PHP a welcome message after a login. I would like to display the name of the user who has just logged in through a variable php. The login screen…