Questions tagged as 'php'

5
answers

php problem with backslash

I have a problem with the special character \ (backslash) in php. If I have the following code: $f="aboca.png"; $ficheros[]=array("title" => $f, "description" => $f, "image" => "select\".$f"); pirnt_r($ficheros); The result is: A...
asked by 21.04.2016 / 21:02
1
answer

Insert decimals from php to phpMyadmin

how are you? I have a question, I want to enter a value from php, such as 155.60, but when I add it to the phpMyadmin database, it saves it as 155, that is, it rounds it, but I need it if or if I presicion it. Place FLOAT on the BD, also probe w...
asked by 18.11.2018 / 05:33
1
answer

php decode json received via _POST

I have the following case: I receive a variable _POST that brings two data in JSON format and I need only take one of those data. I try this, but the result is NULL. Any suggestions? Thank you very much <?php $CuentasBancariasSel...
asked by 20.11.2018 / 03:09
3
answers

Validate if only one file is selected in Laravel

I want to validate a field type file that is not required, but only if a file has been selected validate the type and size This is on my controller: if($request->hasFile('File')){ $file = $request->file('File'); $name...
asked by 23.11.2018 / 21:25
1
answer

Using Docker and Laravel I have this error with MySQL: "SQLSTATE [HY000] [2002] No such file or directory"

I have an app in laravel 5.2 that connects to my mysql local database, without problems. But, when placing the app inside a docker container, it can not connect to the database and I get this error: SQLSTATE[HY000] [2002] No such file or dir...
asked by 29.11.2018 / 20:10
2
answers

Bring everything from MySql with PHP and show in JSON

I have a problem with PHP and JSON. What I do is try to bring all the data from the database, but it only shows me the first one. If I put a WHERE it brings me the right one but I want everyone and it only brings me the first one. I do not under...
asked by 22.11.2018 / 16:43
2
answers

Make php lists in a table

I have the following requirement I need to associate all the data of common expenses of the month with each user, besides that if you have not common expenses these are individual associate in a td to that user, and in the end it shows how much...
asked by 30.11.2018 / 00:45
4
answers

How do I solve "Trying to get property 'num_rows' of non-object"?

The truth is I'm starting on this php and I have no idea why this error, I try to display the values of my database in a table and I get this Notice: Trying to get property 'num_rows' of non-object in C: \ xampp \ htdocs \ Panel \ index.php o...
asked by 30.11.2018 / 22:44
1
answer

Error with undefined PHP Variable in a site where it is undefined

guys I own a PHP project where I have a file with the functions that must be executed, in this same file I have declaration of the global variables one of these variables is: $usua = $_SESSION['user']['username']; This variable...
asked by 30.11.2018 / 02:45
2
answers

How to subtract values in an array (PHP)?

First I generate an array of 3 positions with random numbers, then I try to subtract the three values from the array. The problem is that if the first subtraction gives me a negative number the next value does not subtract it well. For example:...
asked by 29.11.2018 / 12:44