Questions tagged as 'php'

1
answer

How to save data in a table related to another in Laravel?

I have a model called User that can take on several roles, such as an Administrator, a Supervisor, a teacher, anyway. Therefore for each of the roles I create other entities that will be related to the User model. Now, create a form to be able t...
asked by 21.12.2016 / 03:14
1
answer

How to jump from mysql records using a php loop, and from each iterated record, calculate between field values?

What this code does is to receive in a variable the number of classes taught, in array the number of absences for each student, in another'array' the idGroup, which is always the same, and in another array receives the idAlumno, th...
asked by 21.12.2016 / 00:59
1
answer

Protect a php file that shows json

I have my PHP file: <?php mysql_connect('hostejemplo.com','usuario','contraseña') or die('no se puede conectar'); mysql_select_db('basededatos'); $sql="SELECT * FROM tabla"; $resultado=mysql_query($sql); while($row = mysql_fetch_assoc($res...
asked by 20.12.2016 / 18:56
1
answer

Send data from server to AZURE using JSON

I have files php what they do is insert, show, delete data through json, but I have them mounted on another server, it worked when I used phpmyadmin but I changed to azure and I do not know how You have to perform to do thes...
asked by 20.12.2016 / 15:58
3
answers

Join table fields with different ID

I have this table in MySQL: +-------------------------------+ | *UDH* | *Text* | -------------------------------- | 050003B90301 | Hola soy A | -------------------------------- | 050003B90302 | rmin y...
asked by 21.12.2016 / 14:45
1
answer

Migrate cod to pdo

Hello friends, I am currently in the process of migrating the codes to PDO , which is why I have seen it as more secure, well I'm going through the validation session for users, I share my code that I used to validate the sessions, what I inten...
asked by 09.12.2016 / 22:36
5
answers

Get a lot of records from my MySQL DB using PHP

Warm regards. You see, I have a table "movements" with approximately 300 thousand records, which I wish to obtain through PHP, but at the time of making my query, I do not get results, unless I put a LIMIT. This is my code: $query = "SELECT...
asked by 12.12.2016 / 17:00
1
answer

Best way to carry Paginadas queries

Dear good afternoon, My question is: What is the best way to make or show paged records? I am not sure of how many records the databases like mysql or postgres return queries more slowly. So, what is better? Make a query that brings, for exam...
asked by 11.12.2016 / 00:12
1
answer

Get a value from a multidimensional object PHP Symfony Doctrine

Hi, I'm a beginner and I want to get the value found in the following object specifically in: [id:AppBundle\Entity\BlogPost:private] => 1 and store it in a variable. The first part is the result of print_r and the second part...
asked by 17.11.2016 / 16:21
3
answers

Sentences prepared in PHP

I have a query in SQL , but I do not know how to do it or pass it in routine PHP , since I must make that report. In MySQL it works perfect, but how to do a routine in PHP for this query : SET @sql = NULL ; S...
asked by 17.11.2016 / 16:32