> if ($_POST['usuario'] != '' && $_POST['password']!= '') {
> try {
> $db = new PDO("mysql:dbname=encuestasavandaro", "root","chrystopher");
> }
> catch (PDOException $e) {
> die ($e->getMessage());
> }
>
> $query = $db->prepare('SELECT a.rol, b.usuario FROM rollusuario a,
> usuarios b WHERE a.id_rol = b.id_rol AND password = SHA(:password) AND
> usuario = :usario');
> $query->execute(array('usario' => $_POST['usuario']));
> $results = $query->fetchAll(PDO::FETCH_ASSOC);
> // gracefully exit the database
> $query = null;
> $db = null;
> if (count($results) == 1) {
> // this is actually sufficient to say the user is logged in, no need for
> anything else
> session_start();
> $_SESSION["autentificado"]= true;
> $_SESSION["usuario"]= $_POST["usuario"]."|".$rol;
>
> //my friend in this variable $rol i have to save a.rol from my query....
> how i can do this.....
> }
> else {
> die ('Error message!');
> }
> }
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.