Questions tagged as 'php'

1
answer

PHPStorm displays a message using "include" and "require"

For my IDE PHPStorm reason, this message appears with include and require :    Dynamic include expression 'require_once $ file' is not analyzed.   Include expression is not resolved.     
asked by 29.05.2016 / 22:09
1
answer

How to save HTML in Mysql

I have a deadlock over storing an HTML in the DB. I'm using the property in php: htmlentities($_POST['codhtml']) to perform this operation. But when saving a code like: <span class="frase-aditivo mover" id="adt6-enable" style="transf...
asked by 14.06.2016 / 20:25
1
answer

Instantiating a class and using it in all functions of the same class

I would like to know if I can instantiate another class just once and use it in all other functions of my current class. Sample code: require ('model.php'); class search{ function __construct(){ $objModel = new Model();} fun...
asked by 01.01.2016 / 03:26
1
answer

Initial Value Sequences Postgresql - Laravel 5.1

Hello, I'm running some tests in my application, but I'm having the following problem: After migrate and db:seed , whenever I'm going to insert some registry by applying a duplicate primary key error. I have already seen that this e...
asked by 11.01.2016 / 13:43
2
answers

Error 'Class' MongoClient' not found "[closed]

I recently installed MongoDB on my Macbook, I installed the extension in native PHP, which I'm using along with native apache. The problem is this, if I run the Web page in Apache I get the following message: Fatal error: Class 'MongoClient' n...
asked by 03.01.2016 / 05:14
2
answers

How to list specific data from a table with PDO?

How to list specific data of a table, but using PDO ? I'm starting to study and use PDO , but some things I can not find and that are well explained how to lite the data with a WHERE in the search. MySQLi is used this way, but...
asked by 04.02.2016 / 20:10
1
answer

How to recover terminal data with php?

Example, I have this following command in a php file: <?php $imprimir = shell_exec("cd /home/afonso/Documentos/teste; git add arquivo.txt; git commit -m 'testando'; git push -u origin master"); So far everything works fine, except that...
asked by 29.01.2016 / 13:32
1
answer

PHP run sudo command with shell_exec () [closed]

I have the following problem, I'm trying to run a sh file with php using shell_exec for example: echo shell_exec("./example etc etc"); My problem is that it does not run, is it some permission problem? When I type: php x.ph...
asked by 11.11.2016 / 01:12
1
answer

Format date in INSERT and UPDATE Mysql PHP

Well, I have a data grid with a date, but I have to use a JQuery mask : $(document).ready(function(){ $('.date').mask('00.00.0000'); }); But when I make an INSERT, for example, the date 19.11.2016 becomes 21.11.2019. This same case h...
asked by 19.11.2016 / 21:17
1
answer

Concatenate result of select

I'm having a hard time showing the result of select the way I want. I will explain first what I have and then what I want, I have two tables in the database:    product_type: product_type_type, product_type and product_mark:   product...
asked by 09.02.2016 / 20:27