Questions tagged as 'mysqli'

2
answers

Why is the result added twice when using SUM () with JOIN?

Hi, I have the following question and it is that the sum is doubled and I do not know why, it adds twice the result when using SUM() with JOIN in Mysql. Each result comes out double in INVERSION_VALOR comes out 492 instead of 246,...
asked by 05.11.2018 / 23:15
1
answer

Problem in mysql count php, it works in phpmyadmin and not in php

I have this function that should bring me the account of the records in my database on my page: function cuentaticketspendienteempleado($conexion,$id){ $pendientes = mysqli_query($conexion, "SELECT COUNT(t.id) as contador_tickets, t.id as...
asked by 25.04.2018 / 17:35
1
answer

Operation of -real_escape_string

I have a login, that when I enter a username and password in a form and press "enter" and I have established the connection to the database, use the following line of code: $pass = $mysqli->real_escape_string($_POST['txtpass']); I am inf...
asked by 29.03.2018 / 13:28
2
answers

Message from mysql_fetch_array () expects parameter 1

I was trying to load content into an HTML table with the data I have in the database, but I find this "small" error. I have been visualizing different sites and as I did not find a quick and functional solution I come to you. This is my PHP c...
asked by 25.07.2016 / 07:09
1
answer

How can I replace $ _SESSION with a prepared query?

Well here with a doubt, I currently have querys where I ask for information and at the end a clause WHERE where I ask for that information about the id of the current session, that is only the active user at that moment, and I want to ado...
asked by 01.08.2018 / 04:10
2
answers

Error adding two WHERE conditions in a MySQLi consula?

I want to show data using two conditions WHERE , questions by categories and that these questions are enabled to the public. I do the following: $categoria = "categoria_uno"; $habilitado = "1"; $stmt = $conexion->prepare("SELECT id...
asked by 04.08.2018 / 18:26
1
answer

Can it be verified in DB if it is equal to a string?

I am trying to verify in a field of a mysqli table if it is = an exact string. That is: $consulta = "SELECT count(*) as total FROM productos WHERE productos.stock = 'si' "; Is it well formulated?     
asked by 22.01.2018 / 17:14
1
answer

Same question with different answer

Good morning: To work, take the essentials and it worked. $sql021x = "SELECT * FROM $t00 WHERE 00_idpac= '3' "; //$id el 3 reemplaza al $id sólo para no andar pasando por el buscador. To then include the join (which is not yet) I replaced...
asked by 11.10.2017 / 17:20
1
answer

No MysqlInd does not work fetch_assoc or get_result ()

I do not have mysqlInd then it does not work fetch_assoc sample Fatal error: Call to undefined method mysqli_stmt :: fetch_assoc () ni get_result() Following this solution I'm trying to store all the columns in the queried...
asked by 20.06.2018 / 14:14
1
answer

How to show all data consulted?

I am implementing a system of friendship requests in PHP and MySql. And of course it works for me, but it only shows me only one result, which should show all the results I find. For example, Juan has received 3 requests. There is a text sayi...
asked by 11.10.2016 / 02:50