Questions tagged as 'php'

1
answer

Ajax, Jquery and PHP: Can not read property 'length' of undefined

I've been trying to run this code all morning. One method loads several div, one inside another function renderPage(e){ var contPrincipalLastTwitter = '<div class="principalSeeTwitter">' +...
asked by 30.09.2017 / 19:23
2
answers

Limit amount of results in CakePHP

I'm learning CakePHP and this doubt came to me, if I want to put my limit so that it has start and long range, what would it be like? $posts = $this->Post->find('all', array('conditions' => array(...
asked by 14.09.2017 / 17:03
1
answer

PHP files in Electron, what to do?

A few days ago I started to study about the Electron framework, since I need to make a desktop application for the University, but I present some doubts that I can not solve. I am completely new to Electron and for the moment I have only mana...
asked by 04.02.2018 / 20:44
1
answer

Use of undefined constant length - assumed 'length'

I have the following php code, I miss the title error public function traer_testis($id) { $sql = 'SELECT * FROM testimonios WHERE id_testimonio ="'.$id.'"'; $rs = $this->consulta($sql); $datos = array(); /...
asked by 02.02.2018 / 15:22
3
answers

Does not load localhost: 81, Disadvantages with port change 80 to 81

Friends, I changed the port configuration localhost: 80 to localhost: 81 in the following files: httpd.conf: Listen 81 ServerName localhost: 81 In the configuration (config) in xampp > in Services and port services > where it says main...
asked by 02.02.2018 / 20:00
1
answer

It is possible to use Json Web Token without installing with composer

Very good, I would like to be able to use JWT without installing it with composer, I have seen that a colleague has been able to call the libraries with require_once, the fact is that when I want to use $jwt = JWT::encode($token, $key);...
asked by 26.09.2017 / 18:29
1
answer

Doubt about the syntax of dependency injection

Starting, for example, from this class class Question { private $author; private $question; public function __construct($question, Author $author) { $this->author = $author; $this->question = $ques...
asked by 27.09.2017 / 13:29
1
answer

Update of multiple rows with different values

I'm trying to update different rows with different values, in my sql table, the closest I've come is: UPDATE cursos SET posicion = 11 where Id in (1,2) But it updates me with the same value (11) logically the two rows, I need to give a...
asked by 30.08.2017 / 01:12
1
answer

How to make an UPDATE of records to 3 related tables?

I have three related tables as follows: Now what I have to do is edit the information of a course, for example, the start date and in the quota table edit the amount of fees, to later edit the number of amounts in the table detalle_cuot...
asked by 26.08.2017 / 21:48
1
answer

Dynamic search filter with prepared queries

I want to do a dynamic search filter, that is, to filter data in the database according to what the user wants to search. Currently, what I do is: // creo la base de la consulta $query = 'SELECT * FROM tabla WHERE 1 '; // voy añadiendo las c...
asked by 31.08.2017 / 13:09