Questions tagged as 'php'

2
answers

Why in PHP string can turn function?

In the example I have a function with name of funcao , which is intended only to display the value of the parameter on the screen. When you create a string with the function name and call it as a function, it will be executed:...
asked by 29.01.2016 / 17:33
3
answers

Creating a database for each user

I am setting up a web sales system with php and mysql , where we will have several companies registered, each company being a user that will control their sales. Our team has a question: create a banco de dados for each user,...
asked by 11.12.2015 / 02:52
3
answers

How to perform change in order sequence with SQL statement

I have a form where I display for the user some phases that a particular contract needs to respect, follow the image of said form: Ihavealreadydonetheupdatethatmakestheorderchangeandisworking,myquestionisthefollowing,followingtheexampleofthe...
asked by 14.03.2016 / 18:49
2
answers

How to assign a different value to the variable in each loop?

$azul = "#4285f4"; // AZUL $verde = "#34a853"; // VERDE $amarelo = "#fbbc05"; // AMARELO $vermelho = "#ea4335"; // VERMELHO $color = rand(1, 4); I'm using $color inside a loop but in this simplistic way that my code is, the value of...
asked by 07.12.2015 / 15:32
3
answers

Class attribute does not generate error when commented

I had a question I could not solve. Here are the 3 file codes User.php class Usuario{ //protected $nome; public function getNome() { return $this->nome; } public function setNome($nome){ $this->nome =...
asked by 21.11.2015 / 16:14
2
answers

Use or not use CSS / JS within PHP?

Using CSS / JS within PHP, is there a difference if used in an external file for example? Many pages have CSS / JS inside and also externally, would not it be easier to put all together than splitting one part in code and another externally on t...
asked by 10.06.2014 / 23:37
2
answers

Clause similar to MySQL's LIMIT in MSSQL

I need to run the query below in PHP with SQL Server, however I can not use the LIMIT clause missing in Microsoft queries . $SqlTabelaAtual="SELECT * FROM BusinessCadTabPreco RIGHT JOIN BusinessCadTabPrecoItem ON B...
asked by 15.01.2016 / 15:17
2
answers

Close PDO connection

I have worked with other languages before working with PHP and in some the framework when you opened a connection with the bank it was good to finish it in the PDO so I realized there is no function in the PDO class that closes this connection....
asked by 19.05.2014 / 15:18
1
answer

Check duplicate values in array

My question is: I have the following array: $array = array(10, 30, 10, 40, 40); I would like to know if there is a simple way to display the message: "There are duplicate values" or "There are no duplicate values". The arra...
asked by 17.04.2014 / 22:51
2
answers

Search system - Select within another

Hello, I'm doing a search engine, but I'm kind of a layperson about Querys. The method that I thought to refine the search, which in the case would be a simple search between two fields of a table with several products, was to be eliminated thro...
asked by 08.05.2014 / 22:07