Questions tagged as 'php'

1
answer

Update MYSQL does not work correctly

I have this code: <?php session_start(); if (!isset($_SESSION['user'])){ header("Location: index.php");} include("db_files/db.php"); include("inc/functions.php"); $oldpass = mysqli_real_escape_string($db, $_POST['oldpass']); $ol...
asked by 04.11.2016 / 16:35
2
answers

How to extract data from more than two data from a database column to take them to php?

I have the following table in which I want to extract the data from id_sample that are related to id_ott, for which I occupy the following query SELECT sample_id FROM lacem_obras_civiles.msa_register_show whereott_id = 111; Throw...
asked by 09.11.2018 / 18:02
2
answers

Validate $ _GET that does not come from a form

When information is sent from a form, it is validated for greater security with $_SERVER['REQUEST_METHOD'] == 'POST' . But what happens if the parameter that is sent is not in a form and is in a table? <td>{$lista[i]->cod}</t...
asked by 02.12.2018 / 16:24
4
answers

How to differentiate 2 id within the same query

I have the following quey: $query = "SELECT pedidos.*, users.id, users.nombre, users.email, users.username FROM pedidos INNER JOIN users ON pedidos.usuario=users.idusuario WHERE (email LIKE '%$busqueda%' OR nombre LIKE '%$busqueda%' OR monto...
asked by 15.11.2018 / 16:50
4
answers

Error inserting data with php and mysql

I have the following problem when trying to enter data to my bd these are the codes: <html lang="en"> <head> <meta charset="UTF-8"> <title> Creacion de Usuario Operador </title> <link href="estilos.css" rel="st...
asked by 20.07.2017 / 11:11
3
answers

Migrate my database from mysql to laravel

I am new with Laravel and I am seeing if there is a way to pass the database that I have in mysql, to laravel to be able to work with them. I've already tried: Modify the .env. Modify config/database.php . But what I find is th...
asked by 18.11.2016 / 16:55
1
answer

How can I create a PDF document with PHP [closed]

Hello good day I am looking to create a pdf document of a report that I generate with php and mysql. in my query I just drag all the user's data and I simply want to pass them in the pdf file. what tool could you use to create the document...
asked by 06.06.2017 / 23:57
2
answers

lastInsertId () from PDO or SELECT MAX ('id') from MySQL

I am presented with the following question at the moment of wanting to insert in two tables, and this is what would be the best or most optimal at the moment of retrieving the last inserted id from a table so that later it will be inserted in an...
asked by 16.09.2018 / 02:59
1
answer

Return 2 values of a multidimensional associative array

having this array: $materias= array ( array("nombre"=>"Juan","Programacion"=>8,"Redes"=>7,"Dise&ntildeo Web"=>10,"Conectividad"=>9,"Idiomas"=>8), array("nombre"=>"Sofia","Programacion"=>9,"Redes"=>10,"Di...
asked by 08.05.2016 / 23:58
2
answers

Problems taking the variables with REQUEST AND POST

I am trying to use a variable that I have brought with $_REQUEST[] and then in a condition where I say that if the method was POST, I execute a query in which I use that variable but it does not take it correctly. This is the code, the...
asked by 19.05.2016 / 16:55