Questions tagged as 'php'

1
answer

How to do a SELECT between two tables and their WHERE's?

I get the category ID, and with it I look for the subcategories. For this I am using WHERE's. How would you use INNER JOIN? The WHERE's question confused me <?php namespace Application\Models; use Application\Models\Model; c...
asked by 29.01.2017 / 04:23
1
answer

What are the differences between ADOdb and PDO?

What are the differences between ADOdb and PDO? Which one performs best?     
asked by 29.05.2017 / 18:43
3
answers

How to insert index and element into an array

I am developing a loop to compare two tables in a database. The intention is to know how many people were indicated by a same employee of the company. For this, I need to start an array as follows: foreach($linhas as $linha){ $varivael = a...
asked by 04.05.2017 / 17:16
1
answer

How to change a comma, by a point, into a decimal number inside a string

I was trying to do the following: String: ajskjnsjs, eeiisois, 10,98 oismsnsjh; In this case, you just wanted to change the comma of the number by a period , leaving the rest of the string equal. I was using the regexp_...
asked by 05.04.2017 / 00:32
3
answers

How to do dynamic and generic preparation with mysqli?

I have a mobile application that sends me the following parameters $tabela = $_POST[“tabela”]; // ex: “pessoa” $atributos = $_POST[“atributos”]; // ex: “codigo, nome, cpf” $valores = $_POST[“valores”]; // ex: “10, Rafael, 1234567890”...
asked by 20.01.2017 / 11:21
3
answers

Optimization of PHP functions for querys to the database

I often see different functions in PHP for each query . I would like to know if there is any way to do the following in an PDO connection: function get_user_data($table, $columm, $required) { $db = conn(); $data = array(':value' => $r...
asked by 06.03.2015 / 11:03
4
answers

How to check if an input has a String?

I need to check if the user typed a string in a field where they can only receive an Integer, I made the sequential code and when I click the button, it always returns the alert regardless of whether I write an integer or a string, what's wrong?...
asked by 02.03.2015 / 18:41
3
answers

Can arguments be harmful?

By default, arguments to a function are passed by the value (that is, if the value of the parameter within the function is changed, it is not changed outside the function). To allow a function to modify its arguments, they must be passed by ref...
asked by 10.04.2015 / 01:05
2
answers

Shorten string size

Is there any way to shorten the string size type zipar it and then deszipar equal to the base64 function does?     
asked by 07.04.2015 / 23:10
3
answers

Pass API Google Maps for JPG image

I have this code below: <iframe width='500' scrolling='no' height='200' frameborder='0' id='map' marginheight='0' marginwidth='0' src='https://maps.google.com/maps?saddr=São Paulo - SP, Brasil&daddr=Rio de Janeiro - RJ, Brasi...
asked by 04.04.2015 / 17:18