Questions tagged as 'php'

3
answers

Why is ':' used in queries?

I was seeing a script in php and I noticed that every time an SQL query was written, this "operator" was used. A part of the code $sql = "INSERT INTO categorias (nome) VALUES(:nome)"; $stmt = DB::prepare($sql); $stmt->bindParam("nome", $...
asked by 25.07.2014 / 17:55
2
answers

Problem with quotation marks when doing INSERT SQL

I'm doing a CRUD with PDO, but the prepare () method query only works with "double quotes" Ex (this works): "INSERT INTO '_user' ('firstname') VALUES ('blabla')" That's not how it works: "INSERT INTO '_user' ('firstname') VALUES ('blab...
asked by 15.09.2014 / 20:39
3
answers

Execute action after 2 minutes without moving the mouse

How to create a function in jQuery that redirects the visitor to a page after it does not move the mouse for 2 minutes or more? Example: The user is on the products.php page and if the user is left standing with the mouse or he is on...
asked by 22.07.2014 / 00:44
3
answers

INSERT Query does not work inside a loop

So folks, I'm not able to solve this problem of a query inside a foreach loop does not execute. First of all I thought it was something wrong with pdo-> beginTransaction so I commented this part and left pure code only. <?php if (is...
asked by 10.08.2014 / 01:31
2
answers

News only for a certain group in wordpress

When inserting a post in wordpress, I have the taxonomy 'group' with terms 'pharmacies, grocery stores, snack bars ...', which are the groups, since I already have clients for these groups. What I need is that, when you log in to have restricted...
asked by 21.02.2014 / 15:13
3
answers

Autocomplete jQuery does not show options

Description Need: Need to autocomplete with jQuery , PHP and from what was selected, I get ID , query the database, and display what I need . Problem: I'm not able to display the records in input that load...
asked by 22.02.2014 / 03:53
1
answer

CakePHP - page using more than one table

I have a question, about saving data in the database using CakePHP, when I need to manipulate with more than one table. I am creating a customer registration system and it has a system for registering login's and client's passwords, such as cont...
asked by 24.04.2014 / 16:14
3
answers

How do I adjust my date in my query?

$result_usuario = "SELECT * FROM vendas WHERE DATE(date_created) = '$data' AND tipo_venda = '$tipo_vendas' AND tipo = '$tipo_pagamento' ORDER BY 'id'"; I have this query, but it does not work right because the input that populates t...
asked by 12.12.2018 / 19:57
4
answers

Explanation about concatenation of variables in PHP

I am always in doubt on how to concatenate strings with variables in PHP. I have some difficulty understanding the question of double quotes. I would like an answer that clarifies why you use one or the other and how to put it into practice....
asked by 27.02.2014 / 04:13
2
answers

Create HTML Blocks in Wordpress and call them in the Post or Page

We have a real estate site where we use ACF (Advanced Custom Fields) to better manage real estate pages. One of the fields is the Price List. A price list of a condominium serves several pages of real estate of the same condominium, conseq...
asked by 28.01.2015 / 16:22