Questions tagged as 'php'

2
answers

SQL query with PHP array [duplicate]

I have an array that will be variable, eg $ ref = array ('123', '654', '555'). I wanted to do a SQL query to bring information from these references, something like: SELECT * FROM tabela_itens WHERE ref = (array do PHP) How can I do th...
asked by 02.05.2018 / 19:56
4
answers

Is there any problem in omitting the semicolon in a php tag with an expression only

When using php along with html, I know it works by omitting the ";" in one line php tags, but is there a problem that this can lead to? Omit the ";" is it a good practice or not? <?php algumaFuncao() ?> or <?php algumaFuncao()...
asked by 21.03.2014 / 16:49
2
answers

Create worksheet by adding images and changing line color

This method creates an Excel spreadsheet, with int and string : public function arrayToXls($input) { // BoF $ret = pack('ssssss', 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); // array_values is used to ensure that the array is n...
asked by 17.03.2015 / 14:00
1
answer

How to identify that the user is in the page of my site with Jquery

I'm making a script to identify if the user is on the site or not, but I have no idea how to do this, could anyone help me? My question is the following, I want to know if the user is on my page, for example if the user goes to another tab as...
asked by 11.04.2015 / 16:10
1
answer

How do I know if the user is updating the page [closed]

The user is filling the cart with various items, and I have created a jQuery function where items are summed up instantly and presented to it. As soon as he finishes choosing the items and clicking the continue button, the items and value are sa...
asked by 16.03.2015 / 19:27
2
answers

How to print the SQL statement being sent to the bank?

I would like to know how to write a SQL for control purposes of the statement being sent to the database: $sql = $pdo->query("SELECT * FROM imovel WEHRE CATEGORIA = 'APARTAMENTO'"); How to print the SQL statement being sent to the bank?...
asked by 03.10.2014 / 18:34
3
answers

Problem with search and friendly url

Good evening, I have a search that is working fine, I'm only now having a problem when someone writes a word with an accent or two words separated by space, I break the url. Would you like to know how I can resolve this situation? Code...
asked by 21.03.2015 / 23:39
3
answers

Repeat Loop

As I enter a "," between the items in While and in the last item I put a "e" plus a "." . Remembering that my array will load according to the data in the database. I need it written like this: Pera , Uv...
asked by 04.05.2015 / 13:32
2
answers

Is there any risk in not validating the name of a function used in JSONP?

Generally, when you make a service JSONP one of the things to be passed by parameter is the name of the callback that will be used in javascript. Example: $dados = [1, 2, 3]; $json = json_encode($dados); $callback = $_GET['callback...
asked by 07.08.2015 / 17:32
3
answers

PDO :: Fetch & FetchAll

Because the following code works: $stmt = $pdo->prepare("SELECT * FROM dados"); $stmt->execute(); $codigos = $stmt->fetch(); echo $codigos['codigo']; So I can not use it? $stmt = $pdo->prepare("SELECT * FROM dados");...
asked by 05.05.2015 / 13:52