Questions tagged as 'php'

2
answers

Problem retrieving inserted id

I created a record with a 58 data. As I was creating, I was testing and the data was entering the DB, and every time an insert was made, I get the id of the last set / data group entered. But if I "refresh on the page" when I am go...
asked by 16.12.2014 / 18:12
2
answers

Comparing prepare () vs query () with mysqli

I made a query in the database, with query() using mysqli and num_rows to return the number of lines, see the code: $consulta = $mysqli -> query("SELECT * FROM tabela WHERE Pedido = '$pedido' AND Email = '$email' "); $linhas =...
asked by 19.01.2015 / 15:10
3
answers

What is the simplest way to create a mask for numbers in PHP?

I have two ways to create masks for numbers in PHP, however I do not know if it is the most elegant and effective, so I would like comments to improve the code. I need the function to behave as follows: Format numbers with less than 8 num...
asked by 26.08.2015 / 17:24
4
answers

View the last 5 lines of a file with PHP?

Through Shell , I can display the last 5 lines of a file using the tail command. So: > tail -n 5 public/index.php I'd like to do the same thing in PHP. But I did not want to load the whole file, but actually only display...
asked by 02.09.2015 / 21:48
3
answers

How can I check if the last position of the array has been filled?

How can I check if the last position of the array has been filled? I tried the array_pop function but it seems to cut the array element, I just want to check if at the last position of array there is something ...     
asked by 20.09.2016 / 21:06
1
answer

dynamic url url

As I do for my url that is like this: detalhe.php?cat=1 stay type so detail / television my .htaccess : RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)$ index.php?ur...
asked by 29.10.2015 / 13:14
0
answers

Group code on a line [closed]

Well, I'd like to change my CSS code by adding the parameters that are "joinable" For example this code: { margin-top: -2px; -> juntável com MARGIN margin-right: 40px; -> juntável com MARGIN } margin-X , padding-X parame...
asked by 16.01.2016 / 18:23
1
answer

How to authenticate the application and authorize it to consume a restful API

In a given project, it was necessary to create a restful API that receives data from various forms spread across multiple sites hosted on different servers. The API was created to resolve the following issues: Maintenance: have a single d...
asked by 13.06.2016 / 16:49
1
answer

How many terminal instances are called for each exec () function call in PHP?

If I call a file, which contains the exec() function, on two different terminals, will the second start executing only when the first one ends, or do they work independently?     
asked by 05.07.2016 / 21:03
1
answer

The if conditional is not obeying the rules

I have a problem here in my gallery, when I enter the menu and choose which image category I'm going to choose. For example, if you do not want to be a member of the group, you should go to my controller and pick up the images where a field name...
asked by 11.10.2016 / 19:08