Questions tagged as 'pdo'

1
answer

Error executing query in php

Good, I am trying to separate a query from a web page in different pages but at the time of making the query I get the following error:    Fatal error: Uncaught PDOException: SQLSTATE [42000]: Syntax error or or   access violation: 1064 You h...
asked by 07.12.2017 / 00:03
1
answer

How to assign the result of a select of a table to different variables

I make the query: SELECT cat_img, descripcion FROM 'CAT_PRODUCTO' WHERE id_gal BETWEEN 1 AND 7 Now I want to assign the result to different variables according to id_gal example: $catimg_1: imagen extraída del registro id_g...
asked by 02.12.2017 / 14:20
1
answer

Warning: Invalid argument supplied for foreach () PDO / SQLServer

Greetings, I have a code that is giving me problems with a foreach and I have not achieved its correct operation, it is a query to a database SQLServer with PDO ODBC, I have tested the queries separately in PHP and it does not give...
asked by 28.12.2017 / 14:59
1
answer

How can I avoid repetition of values in columns in a Mysql table?

I've already tried it with UNIQUE and CHECK but it does not work for me. If there is a teacher with a subject, I would like you not to put the same subject back to me, because the rest of the code I have makes it repeat. * * * for($i=0;$...
asked by 22.11.2017 / 18:03
0
answers

MySql query for 1 TB database

Good morning, I am faced with the problem that because of the size of the query, it is impossible for me to execute it, and it is not feasible to cut it into very small pieces because it would never end. I'm using the Laravel 5.5 framework, but...
asked by 01.12.2017 / 10:09
1
answer

Help, insert records in related tables using php oo

Greetings friends, since yesterday I'm trying to solve an exercise but I can not find a solution for now. I have 2 tables in my DB called ts_client and another ts_quipment , the relationship is 1: n a client can have many computers. Previou...
asked by 18.11.2017 / 21:29
1
answer

MySQL with php LIKE and PDO

Hi, I hope you are very well, this is my first introduction with PDO and it made me very interesting, as a result of this I have had some doubts about the SELECT that I hope you can help me at the moment I have this like this: SELECT id...
asked by 12.11.2017 / 18:06
2
answers

PDO - UPDATE - PHP

I have a problem with an UPDATE, to simplify the data I take it from a form and they pass it as parameters to a function, I do the UPDATE and when it does the execute () it tells me that if it was done, but it never does the modification....
asked by 24.10.2017 / 03:55
2
answers

What is _VIEW_PATH_ in require_once? _

I was practicing examples in php and I found this example of require_once, but it generated doubts for me that it is _VIEW_PATH_: public function index() { $model = $this->empleado->listar(); require_once _VIEW...
asked by 23.09.2017 / 23:27
1
answer

How to insert multiple arrays using PDO from a PHP form?

Hi, I have a code that works to insert multiple records but only one array, I plan to add more inouts with different arrays but I can not find how to modify the part of the arrays. I imagine that in the case of the sql it would be something like...
asked by 29.08.2017 / 18:27