Questions tagged as 'php'

1
answer

Why does the PSR2 standard require us to use 4 (four) spaces instead of tab?

According to one of the items specified by the standard PSR2 (to which most of the PHP libraries), we have: Codes MUST use 4 indentation spaces, not tabs. I know the pattern exists, but I wonder if there is any special reason. What i...
asked by 01.02.2016 / 18:41
1
answer

Write video file after capture on site

I have a page that captures a video + user's audio using HTML5 and JavaScript. The code follows: <video width="600" height="400"></video> <input type="button" id="stopbt" value="stop"/> <script type="text/javascript">...
asked by 20.11.2015 / 12:15
1
answer

MVC Folder Structure

Hello. I'm trying to build my own application using the MVC standard. I understand the separation of each item (Model, View and Controller). However, I want to do some sort of separation between Front-end and Back-end, since some Backend Control...
asked by 08.09.2015 / 20:04
1
answer

Pass varialvel to modal

I have a page with a table whose code field is link that opens a modal. I need that when opening the modal, show another table, only with the data according to the value of the field (code) clicked. How do I get the value of the chosen field wit...
asked by 10.08.2015 / 20:28
1
answer

Extend the PHPWord class in CI - class not found

I'm trying to put the PHPWord library in codeigniter, so I downloaded PHPWord and extracted the PHPWord folder and the PhpWord.php file to the third_party folder of CI. After that I created in the libraries folder a file with the name word.ph...
asked by 09.01.2015 / 12:00
2
answers

PHP: elements with and without explicit keys in the same array

I'm trying to figure out a better or cleaner way to do something like this in PHP: // Isto será passado como argumento de uma função... $params = array('Nome', 'Idade', 'Mail' => '[email protected]'); "Name" and "Age" are values with keys a...
asked by 31.07.2014 / 16:43
1
answer

Laravel Eloquent Relationship Performance

I realize that in Laravel 4 Framework , when we have a relationship, instead of using JOIN of Mysql in the source code of Eloquent , it uses a select. For example. I have these two Models. class Usuario extends Elo...
asked by 29.01.2015 / 16:00
3
answers

Insert line break in field text in database

I have a table with a field type text , the field stores a string string imported via file .csv , it was inserted without a line break and I'm trying to insert it, that the line break should happen after the "-", hyphen hyphen spac...
asked by 08.02.2015 / 14:17
1
answer

How to insert into a database with special characters?

I am doing the following INSERT : $result = mysql_query("INSERT INTO tbl_livro VALUES (NULL, '$titulo', '$autor_livro')"); What happens is that there are authors who have names with special characters, for example: O'Reilly Media, In...
asked by 29.01.2015 / 12:08
3
answers

List the months, per year in mysql

I'm trying to do the following in php and mysql : What is in parentheses is the number of results within each month. For this, I am saving in my database, in the tbl_noticias table the data field of type yyyy...
asked by 24.03.2014 / 13:11