Questions tagged as 'php'

1
answer

How do you translate 'mysqli_fetch_array' in the code and screen, what are you doing? [duplicate]

<?php include 'conexion.php'; $consulta = mysqli_query ($conn, "SELECT * FROM Usuario"); // error mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in -----> // se arreglo viendo el error as...
asked by 16.08.2018 / 18:01
1
answer

Problem when opening txt hosted on server

The fact is that I have a website where I have a link where when I press it, a txt that has several lines is downloaded, for example, it is like this:    123455       456789       234566       234354 But when you download it and open t...
asked by 20.08.2018 / 12:47
3
answers

Null value in MySQL with PHP

Ajax is used to insert data, and although at the time of inserting, it works correctly, the problem is when they are inserted in null. It should be noted that the data to be inserted is of the date type in the database. when inserting an e...
asked by 20.09.2018 / 19:39
1
answer

Order of parameters. PHP [closed]

I am reading the PANDA PHP book for beginners, and in a section it appears Order of the parameters, which I have to pass Where do I get that order? What is the ideal order?     
asked by 26.10.2016 / 06:27
5
answers

Sort priority when making an update

I have the following table where I sort by priority ASC ---------------------- |prioridad|actividad | |---------|-----------| | 1 |act1 | | 2 |act2 | | 3 |act3 | | 4 |act4 | | 5 |a...
asked by 05.09.2018 / 17:11
3
answers

Generate a JSON file from PHP

I'm connecting to my database, but I do not want to show the result in the template of the page but to generate a file .json . The PHP code I use is: <?php $sql = "SELECT * FROM AttributeKeys WHERE atID = 1"; function connectDB()...
asked by 06.09.2018 / 12:03
1
answer

Logic in MySQL Query only if 2 conditions are met

I have the following code: $query = "SELECT * FROM pedidos WHERE usuario = '$usua' AND status_pedido = 'ESPERANDO' "; $result = mysqli_query($db, $query); if ($result){ echo '<div class="alert alert-danger" role="alert"" >...
asked by 30.08.2018 / 15:17
1
answer

Browse array and generate json with PHP

I have the following PHP code: <?php require_once('../conexion.php'); $con = mysqli_connect($host,$user,$pass,$db); mysqli_set_charset($con, "utf8"); if ($stmt = mysqli_prepare($con, "select idusuario, cuenta from usuarios")) { //mysqli...
asked by 01.08.2018 / 21:03
2
answers

Multiply by the boolean result of a number

I have the hours worked by a worker and the daily salary. Such that: $horas = 8; $precio = 88; $pagar = 0; if($horas > 0){ $pagar = $precio } return $pagar. Work what you work, unless $horas is 0, I'll pay for the day. Then...
asked by 07.08.2018 / 12:13
2
answers

Edit edit with PDO

**Este es el error que me tira no se si tengo bien hecho el codigo** Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE [HY093]: Invalid parameter number: parameter was not defined' in D: \ xampp \ htdocs \ frosted proje...
asked by 11.08.2018 / 03:36