Questions tagged as 'php'

1
answer

How to calculate fixed date in php?

Well, guys, this is it. I need a button to be released only after 8 o'clock on Sunday. For example, the client sends the file to the site. It can send the file on Sunday or Monday at any time. But he will only be released to download the next Su...
asked by 10.08.2016 / 22:04
5
answers

How to change the end of a name

Changing the end of a name for example WELITON, MAICON, WELIGTON for WELITOM, MAICOM, WELIGTOM     
asked by 11.08.2016 / 00:13
2
answers

Problem with INNER JOIN

Good evening, I'm doing a inner join of 3 tables but I can not get it to work I should have some error that I can not detect or do the right way I'm new to it inner join PHP SELECT *, (SELECT * FROM categorias_estabelecim...
asked by 30.07.2015 / 21:14
1
answer

Show latest results however with ASC ordering in PHP

I would like to show the last 10 results found in a table, but with ASC ordering. I'm using the following: $listarResultados = $pdo->prepare("SELECT * FROM teste WHERE categoria = 'cateste' ORDER BY id ASC LIMIT 10"); $listarResultados ->...
asked by 15.08.2015 / 23:15
1
answer

Error in the PDO database

I am creating a page that saves values in the MySql database using PDO and is not writing the data. I'm using the following code: <?php $conexao = new PDO('mysql:host=localhost;dbname=dbTeste', 'root', ''); $query = "INSERT INTO names(...
asked by 14.08.2015 / 20:57
1
answer

How to set up a query with optional conditions?

In the example: SELECT * FROM exemplo WHERE ID in(2, 3, 4) It does if you have these ID in the bank. PHP: $id= implode(', ', $_GET['id']); $nome= implode(', ', $_GET['nome']); $cidade= implode(', ', $_GET['cidade']); $q...
asked by 04.08.2015 / 17:51
1
answer

Is it true that ++ $ variable (pre-increment) is faster than $ variable ++ (post-increment)?

Is it true that ++$variavel is faster than $variavel++ ? In this answer given in SOEN , we see the following excerpt:    ... however pre-incrementing is almost 10% faster, which means that you   should switch from post to pre...
asked by 18.08.2015 / 17:00
2
answers

Questions about Vagrant

I'm learning to work with the vagrant , I've already created VirtualMachine , I made the provisioning, the project ran perfectly. But when I enter via ssh in VirtualMachine to run a script php , which runs via shell, is expe...
asked by 12.02.2014 / 12:36
1
answer

How to use Elasticsearch next to MySQL? [closed]

I want to use elasticsearch to see if I can agility and speed in my MySQL queries. I started to see a few things, but I found the issue of integration with MySQL a bit confusing, does anyone have any experience with elasticsearch, and can you...
asked by 30.01.2014 / 20:12
2
answers

Determine the field in ORDER BY RAND () in mysql

Determine which table field will have ORDER BY RAND () Example: show random data according to field (category_id) How do I put a: WHERE ORDER BY RAND () id_category ???     
asked by 15.05.2014 / 16:05