Questions tagged as 'pdo'

2
answers

PDO vs Doctrine

Work with system development in PHP , more focused on e-commerce . Currently I use PDO to perform my connection to the database, but out of curiosity I decided to search on Doctrine , because when I was developing in C # in NHibernate , w...
asked by 24.03.2016 / 12:54
1
answer

Problem with dynamic UPDATE in PDO

I'm creating a CRUD dynamic in pdo , where I get several parameters inside an array, and inside this array there can be several other arrays. The problem is when I'm mounting SQL. I asked a similar question here , but the solution was not...
asked by 14.12.2015 / 18:58
2
answers

Difference between the fetch and setFetchMode methods of the PDO

I've understood the difference between fetch and fetchAll, but now, what's the difference between these and setFetchMode? It looks like it's the same thing ... (at the time of riding at least). I can do both like this: fetch(PDO::FETCH_ASSO...
asked by 16.08.2017 / 01:08
1
answer

Integrity constraint violation: 1048 Column 'name' can not be null

I'm trying to create a system to upload PDF's and it always returns me the following error:    Error Registering! - SQLSTATE [23000]: Integrity constraint violation: 1048 Column 'name' can not be null and with all fields returns the same...
asked by 23.04.2015 / 06:52
1
answer

PDO without JSON support

I need to return a row in JSON, but the PDO does not seem to give full support to operations. Always the type 245 error message.    PDO :: prepare (): Unknown type 245 sent by the server. Please send a report to the developers I tested...
asked by 18.07.2017 / 05:19
3
answers

Update in two columns, two tables

I have to update two columns in separate tables, but I do not know the commands very well, I would not like to use triggers. Will be updated around 100 records. Here is an example: Table a id nomes nota 1 SOen etc1...
asked by 15.06.2014 / 00:25
2
answers

Search with MySQL PDO in Array

I have this code: $whereBusca = "itaim-bibi"; $whereBusca = explode(',', $whereBusca); $sql = $pdo->prepare('SELECT id, nome, caminho FROM regiao WHERE caminho IN (:whereBusca)'); $sql->execute(array("whereBusca" => "'".implode("','"...
asked by 18.12.2015 / 14:11
1
answer

Efficiency of PHP Query Execution PHP

Is there any performance difference in the codes below? $result = $pdo->query($sql); foreach($result as $reg){ ... } and ... foreach($pdo->query($sql) as $reg){ ... } I did some testing, but the behavior of the runs does not seem...
asked by 29.01.2016 / 18:40
2
answers

Insert MySQL PDO

Well, I need to do an insert and I use PHP OO, however, how should I do this? According to my code it is registering, but it is not working perfect. Am I doing something wrong? You do not get any error messages, just say you are successfully...
asked by 24.08.2015 / 16:07
1
answer

Change a Select mysql to a Select PDO

I have a Select from sources listed in a table, and I currently use this code to list them so that the user can choose the desired font. <select name="tipo_font_end"> <?php $select = mysql_query("SELECT * FROM fontes");...
asked by 09.05.2015 / 20:16