Questions tagged as 'pdo'

1
answer

Login by session roles

Good afternoon, nights, I'm doing a login for session roles and with two it works perfectly, so like this: user.php <?php session_start(); if(isset($_SESSION["usuario"])){ if($_SESSION["privilegio"] == 0){ }else{ header(...
asked by 04.05.2017 / 21:20
1
answer

Drop down list with PDO [closed]

Good morning, I'm trying to get the data in a combo and I do not know if something fails me, you should show me the fixed options. $pdo = new PDO('mysql:host=localhost;dbname=prueba', 'root', ''); $sql = "SELECT acro_subcategoria FROM tipodocu...
asked by 18.04.2017 / 11:05
1
answer

Optimize consecutive sql statements

In a PHP code you have a series of consecutive UPDATES (could be more) $sql= "UPDATE SENTENCIA X"; $sth = $BD->prepare($sql); $sth->execute(); $sql= "UPDATE SENTENCIA Y"; $sth = $BD->prepare($sql); $sth->execute(); $sql= "UPDATE...
asked by 27.04.2017 / 18:50
1
answer

Print two queries in the same "td" or "select"

Good morning, I'm doing a CRUD, and right now I'm making a table where I can select modify or insert users, well I come to the conclusion, that when I pass the table to users they choose for example which user they want to select, but they can o...
asked by 27.04.2017 / 08:55
2
answers

Check correct UPDATE in MySql with PHP-PDO

When launching a INSERT MySql with PDO I have the same result whether the update is done or not, as long as no errors occur, ie if for example the update does not meet the conditions of WHERE will not occur. Example: $sql = "UPDATE...
asked by 30.03.2017 / 00:48
1
answer

Activate PDO_OBDC drivers for PHP?

Sincerely since I do not touch php. Now at the University we will work with Arduino boards and we want to make a mini server with a web page hosted on it. Well, as things are going to be simple, I have decided to use Access ... I've been doin...
asked by 21.02.2017 / 22:55
1
answer

Pass a variable from one form to another PDO form

I have a form that is very large and for that reason I have split it into two pieces the first form registers well and like the second the only problem is that when I register the second form does not keep the ID of the first form that variable...
asked by 06.02.2017 / 08:06
2
answers

Catchable fatal error: Object of class PDOStatement could not be converted to string in on line 24

I want to pass the results of the two queries in the same variable so that I can show it in a table, but I throw that error in the code, the code is as follows: <?php include("../BD-Config/config.php"); session_start(); // liste des évé...
asked by 20.01.2017 / 17:24
1
answer

pdo date format

hi I want to show the date in this format in a query "d-m-Y" because when the storage in the bd is stored in this way "Y-m-d" type date append a piece of my query, thanks in advance 'while ($linea = $consulta->fetch(PDO::FETCH_ASSOC)) { ec...
asked by 13.02.2017 / 06:50
1
answer

serious error with materialize.css checkbox

Hello friends, I'm having problems with the materialize.css checkboxes. I'm doing a query in alphabetical order but when I try to make the selection of any medication it only lets me select the first of each letter, but if I remove the...
asked by 02.03.2017 / 06:12