Questions tagged as 'php'

4
answers

Query DB and show all results except first

I have the tbl_galeria table, what happens is that I want to make a query, but the query can not show the first result. That is, the query will return all values except the one with the smaller id. $query = mysql_query("SELECT * FROM tb...
asked by 02.07.2014 / 15:23
4
answers

How to execute two querys on a declaration?

I need to mount a MySQL query that returns me the total of rows, and the total of rows with a value greater than 1 in the same query. Total lines : SELECT COUNT(*) FROM tabela Total lines value greater than 1: SELECT COUNT(*) FR...
asked by 26.12.2014 / 20:11
2
answers

check if GET value exists or not

I created an array calling names, inside that array I have 3 names $nomes = array ('carlos', 'maria', 'jose') Later in the code I'm trying to create an if where it checks if the value of GET exists inside this array, but I'm not getting it....
asked by 02.08.2014 / 16:38
4
answers

Get most used words from a string

I have a large string: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas porttitor non felis quis dignissim. Morbi varius arcu lorem, eget efficitur nibh interdum vitae. Aenean tristique hendrerit diam a consequat. Nunc eleifen...
asked by 20.12.2014 / 22:01
3
answers

Problems with PHP encoding in UTF-8 [duplicate]

None of the solutions suggested in various forums, websites and the like worked. I ran several tests and none of them worked and so I came here. The website where the error occurs is this: link It was not developed by me, a client of m...
asked by 29.10.2015 / 17:37
3
answers

Create select using cycle "for"

I tested it in many ways, and I can not create a <select/> with a for in PHP. The question is simple, I have a for ranging from 1 to 48 , and I need to return those 48 numbers to a select ....
asked by 14.04.2015 / 16:14
3
answers

Protect secret configuration file

I have a file isolated from others called config.php . It holds information from 3 databases and some sensitive passwords, but necessary for the functioning of the system as a whole. I wanted to protect this file somehow, anyone who acce...
asked by 07.03.2015 / 13:25
3
answers

How to View Json in PHP

I get a user from a DB via API. <?php require "vendor/autoload.php"; use Intercom\IntercomClient; $client = new IntercomClient(App_ID, App_Key); $client->leads->getLeads(['email' => '[email protected]']); ?>...
asked by 17.08.2016 / 14:25
3
answers

Simplifying an Array - PHP

I have a multidimensional array where the data is as follows: Array ( [0] => Array ( [0] => Array ( [0] => Brasil [1] => Franca [2]...
asked by 04.07.2016 / 22:49
2
answers

SQL result has field and index

I have a function in PHP to automate the queries I make: //arquivo funcao.php function executaSql($sql, $param=array()){ try { include "config.php"; $q = $conn->prepare($sql); $q->execute($param); $res...
asked by 28.07.2016 / 15:05