Obtain the user_code from a database, using sessions

0

Currently, I am working with sessions on a web page, which emulates the social network "LinkedIn", so that a user can make a publication, the following MySQL request is executed:

INSERT INTO tbl_publicaciones(codigo_usuario, contenido_publicacion, numero_likes, fecha-publicacion, ubicacion) 
        VALUES (%s,'%s',null,NOW(),'%s')"

In order to publish the information in the table tbl_publicaciones, you need the user code, which is not how to implement in the query because the user code I have implemented on the page "muro.php" where the publications

$sql = sprintf( 
    "SELECT codigo_usuario, codigo_genero, nombre_usuario, apellido_usuario, correo, contrasena, url_imagen_perfil, titular, educacion, logros FROM tbl_usuarios WHERE correo = '%s' and contrasena = '%s'",
    $_SESSION["usr"],
    $_SESSION["psw"]);

This is the php code that I have on the page "muro.php"

    
asked by LPSoldier19 08.05.2018 в 07:42
source

0 answers