Questions tagged as 'php'

2
answers

Is there a function to reindex a multidimensional array?

Well, I need a help, I have a function that returns the following array: Array ( [0] => Array ( [0] => valor1 [2] => valor2 ) [1] => Array ( [0] => valor3 [1] => valor4 [...
asked by 27.11.2014 / 12:35
2
answers

Can you use the same query and set two different "ORDER BY"?

I use the following excerpt for one queried to the database $cs1 = $pdo->query("SELECT TITULO, URL, IMAGEM , TEMPO FROM post ORDER BY CLIQUES DESC LIMIT 5")->fetchAll(); I would then like to explore this query further in order to use...
asked by 08.12.2014 / 00:05
1
answer

Error function not defined

Follow the code: <?php if (isset($_GET['algumacoisa']) && !empty($_GET['algumacoisa'])) { $user = "useradmin"; $pass = "senha123"; mysql_connect("localhost", $user, $pass); mysql_select_db("meubancodedados"); $co...
asked by 10.12.2014 / 02:44
1
answer

Generate these results in PHP MySQL

I would like to know how this type of result is generated ... How it is formatted this way. Mes/Ano | Vencidos | A Vencer | Vencendo 01/2015 | 5 | 0 | 0 02/2015 | 1 | 0 | 0 04/2015 | 15 | 0 |...
asked by 22.07.2015 / 22:33
1
answer

What is the difference between class implementation in C ++ and PHP?

I'm currently working on PHP and realized that at the time of implementing classes I can not just instantiate and then implement below the class using the :: scope selector. Example: class Lista{ public: Lista(){ first = last...
asked by 11.03.2015 / 19:41
2
answers

Doubt about the MOD operator in PHP

I have a PHP code that performs a given calculation, however it is something different from what I expect, I performed the calculations in hand and it did not generate the same result, could someone explain to me why? The code for executi...
asked by 04.03.2015 / 22:13
1
answer

Set time to expire $ _SESSION

How to adjust the time to expire $ _SESSION? attempts .. Include in top of files (worked in localhost offline) ini_set('session.gc_maxlifetime', 3600); // 1 hora ini_set('session.cookie_lifetime', 3600); session_start(); And also se...
asked by 17.03.2015 / 20:31
1
answer

Advanced ordering of items in an array

I have an advanced report, which ultimately sorts the items based on your score: // Variável $relatório contém dados levantados e calculados em blocos para N itens. Cada bloco possui uma pontuação total do mesmo. // Ex: $relatorio[0]['consoli...
asked by 24.03.2015 / 20:27
1
answer

How to check if a session exists (CodeIgniter)

I have the following function in my Controller : private function SetImageAndColor($client_id) { if (isset($_GET['color']) AND isset($_GET['image'])) { $dados['click2call'][$client_id]['image'] = $this->input->get('imag...
asked by 20.03.2015 / 14:10
2
answers

Access the data of an Array that receives 2 Arrays

Let's say I have an Array $testes that gets 2 arrays $variavel1 and $variavel2 . So I make $this->set('testes', $testes) to use in the view. In the View how do I access the values of $variavel1 and $var...
asked by 06.05.2015 / 16:58