Questions tagged as 'php5'

2
answers

Print data from a JSON with PHP

I want to print data specific to a JSON. I have the following code: <?php $summoner = "ErickReplay"; $key = "mikey"; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETUR...
asked by 03.06.2017 / 11:08
1
answer

Script php, insert data in mysql

I have this PHP script where I make an insert query in a mysql DB, what I do is declare a mysqli object globally and then from a function make the insert, but since the insert function gives me an error, it tells me that recognizes the $ mysqli...
asked by 16.05.2018 / 17:58
2
answers

Make Insert in a database with php

Good morning, I'm trying to add a statement to the database, I'm doing it from an insert. I have five variables, the id, the name, the description, the image and if I want to show the news or not. The connections to the database I have alread...
asked by 28.08.2017 / 11:20
1
answer

SELECT does not work on a database with PHP

I'm trying to make a simple login. The idea is to look in the database for the user and password. The fact is that I have a SELECT that should take the rows with name and user that match those previously entered by the user. The...
asked by 24.08.2017 / 14:57
2
answers

How to apply str_pad correctly to a string that has asentos

I have this situation, I am applying the function    str_pad to fill a text string with spaces, but the problem is when the string contains accents (accents or ñ), since it tells me that character as if they were two, which causes the str...
asked by 07.09.2018 / 18:56
2
answers

How to subtract a specific time with the system time in php?

How can I make the $ total variable give me a result in hour format? Now with this code, the only thing I achieve is to subtract the hours, but not the minutes, and it only shows me a number. example: 07:45 - 03:35 = 4. I would like instead of g...
asked by 13.06.2018 / 03:22
2
answers

Exec command does nothing in PHP

I have the following code: <?php echo "Hola mundo."; exec ("uname -a"); exec ("echo uname -a"); ?> the exec command does nothing on the two lines. I'm newbie in php and I'm stuck. SO Lubuntu 18.04 xampp 5.6.30 PHP Ve...
asked by 17.08.2018 / 03:37
1
answer

Laravel / Lumen - Serialize an object

Good I have 2 models in my Lumen project, one is Cars and the other Users, the relationship that I have defined is that 1 user can have N Cars User Model <?php namespace App; use Illuminate\Auth\Authenticatable; use Laravel\Lumen\Auth\...
asked by 20.02.2018 / 13:05
2
answers

Problems generating a table with php from a two-dimensional array

Hello this is my code and although I put the rowspan to 3 does not generate the table correctly, I try to generate a table from a two-dimensional array with PHP but when formatting the table does not come out as it should, I can not find the err...
asked by 09.01.2018 / 23:55
1
answer

Send variable between two php files

Good morning I have a page where I show a sql table. And I want if the user clicks on a title it shows only the information of a row. I am trying to do so, news.php: <form action="new.php" method="post">...
asked by 31.08.2017 / 13:46