Questions tagged as 'php'

1
answer

How to know the line number where the ID was displayed

The problem is as follows. I have a while that takes values in the database: ... while ($produto = mysql_fetch_array($produtos)) { echo "<tr>"; echo "<td>".$produto['id']."</td>"; echo "<td>aut...
asked by 22.08.2015 / 19:47
1
answer

SQL Server PDO error: There are no more rows in the active result set. Since this result is not scrollable, no more data may be retrieved

I'm trying to get records from a table and write to another of the same type, but I'm having this error:    There are no more rows in the active result set. Since this result set is not scrollable, no more data may be retrieved. The code...
asked by 27.04.2017 / 17:15
2
answers

How to remove character that is not a letter in a string?

I have a array of strings that returns me as follows: Array ( [0] => motivação, [1] => sentimento33 [2] => que.. [3] => 56nos [4] => impulsiona\ [5] => proporciona [6] => investir^^ [7]...
asked by 15.04.2017 / 15:32
1
answer

treat date and time php [duplicate]

I'm developing a posts system, where in the footer of each is displayed the moment the post was published. For this, I use diff to calculate the difference between the current date and the date the post was published. I want that, wh...
asked by 10.01.2018 / 20:36
1
answer

Remove number sequence of string

I have the following problem, I believe I can solve it with regular expressions, but I'm bad with it. Let's say I have a string like this: CONECTOR BNC FEMEA + F MACHO 024267 or so PLUG P-4 UNIVERSAL 006-096 , the position of the...
asked by 13.02.2017 / 12:14
2
answers

List files and get PHP comments with PHP script

I would like an idea if possible or a script that first read all the .php extension files from a folder by taking the PHP comment from each of the that have after File Name: . <?php /* File Name: exemplo */ ?> and throw...
asked by 22.02.2017 / 19:19
1
answer

What is the overhead of using Doctrine?

A few days ago I've been arguing with some co-workers about performance and high availability. In the middle of the discussion one of the points raised was that when reaching a certain number of requests, Doctrine ORM becomes a bottleneck i...
asked by 15.02.2017 / 18:03
1
answer

When relating two tables, is the correct side of SQL, PHP or whatever?

I have this doubt of what it is preferable to do when I need data from the two tables to get the result. I always did the comparison in PHP, but I learned the SQL relationship commands that could help. What is the most correct way to do it, p...
asked by 17.12.2016 / 21:44
1
answer

Use .php file instead of .js

I want to use an external .js (JavaScript) file in my project but would like to use PHP code to handle JavaScript within .js . I know the .js extension will treat the file as JavaScript and if I enter <?php ... ?>...
asked by 25.06.2018 / 02:10
3
answers

Add variables to the session Auth laravel 4.2

I have my Auth session, which returns the user's data: print_r(Auth::user()); In this session, I want to add the company data associated with the user. In my User model, I added the following: public function empresa() { $this->b...
asked by 28.12.2016 / 13:34