Questions tagged as 'mysqli'

1
answer

How to receive a Variable Type DateTime from MYSQL in PHP file

Friends, my intention is to receive the value of a type = datetime field from MYSQL in a php file $sql=mysqli_query($con,"select fecha FROM tabla1 WHERE campo1=1"); $rw=mysqli_fetch_array($sql); $fecha_que_recibo=$rw['fecha']; The d...
asked by 13.08.2017 / 05:40
1
answer

Multiple MySQL queries (msqli) in a php file

I have my connection to the bd so $conn = new mysqli(server,user,pass,mainDataBase); un procedimiento almacenado que devuelve una tabla $sql = "call sp_escap()"; $result = $conn->query($sql); y las imprimo en el label while ($r=mysqli_fetch...
asked by 10.08.2017 / 17:36
2
answers

Save an UPDATE in a variable

I have a question, I would like to save a UPDATE within a variable, for example, this is my code: public static function cancelTareasP(Usuario $_Usuario, $proyecto_id) { $conex = $_Usuario->getConexBD();...
asked by 02.08.2017 / 19:59
0
answers

Problem with image - database - IF

I have this file alta.php , what you should do the IF is to see if the user uploaded image or not, and then store it in the database or do not. This is not happening and I do not find the problem. I leave the codes: Alta.php $categoria =...
asked by 21.07.2017 / 20:56
0
answers

Problems with a php update form, Mysqli

I have a form to update data in a database what makes me this form is that it does not update anything but it does not throw ERROR $host="localhost"; $usuario="root"; $contraseña=""; $base="comercio"; $conexion= new mysqli($host, $usuario, $...
asked by 14.07.2017 / 18:48
0
answers

Ordering a table in html

I'm doing this insipid query: $sql = "SELECT * FROM noticias WHERE vigente=1 ORDER BY fecha DESC"; date is a DATETIME field. Theoretically you have to sort the result from the most recent to the oldest ... well, in PHPMyAdmin it works perfe...
asked by 01.07.2017 / 12:43
0
answers

Load of CSV erroneous

In this code I have a small example of how to load CSV: $message = ""; if (isset($_POST['submit'])) { $allowed = array('csv'); $filename = $_FILES['file']['name']; $ext = pathinfo($filename, PATHINFO_EXTENSION); if (!in_array($ext, $allowe...
asked by 29.06.2017 / 09:13
1
answer

Why does the result of my query to the database show in some letters? [duplicate]

I want to show some concrete data of my database in a widget of my wordpress by means of a php function and a query to a MySQL database, but the problem that I am having is that it is shown in the letters with accent. My HTML has this formatte...
asked by 15.06.2017 / 17:42
2
answers

PHP array problem, echo shows me array

while (true) { $t= "SELECT MAX(id) AS id FROM accidente"; $query2=mysqli_query($db,$t); while($acd[]=mysqli_fetch_array($query2)) $last= current($last_id); $acd_1=current($acd); $ls=(( $last !== false) ? $last : ", &...
asked by 16.06.2017 / 04:04
1
answer

Save a profile photo stored in a database in a SESSION variable and display it

I tried to do it that way but it gives me eror $consulta="Select * from usuario where nickname='$usuario' and pass='$pass2'"; $resultado=mysqli_query($conexion,$consulta); $filas=mysqli_num_rows($resultado); $row=mysqli_fetch_array($res...
asked by 20.06.2017 / 17:49