Questions tagged as 'php'

2
answers

Convert JSON to UTF-8 on Android

I have JSON Array and when it is displayed in ListView on Android, it appears with special characters: JSONgeneratedbyphp:[{"id":"1","titulo":"X-Burg","descricao":"Hambúrguer,...","preco":"R$ 7,50","tipo":"0"},{"id":"2","titulo"...
asked by 03.09.2014 / 14:09
1
answer

Relation between 3 tables mysql

I'm trying to make a relationship between three tables. I have the tbl_eventos table that will be a table where you will save the event and its date. The tbl_servicos_extra table will save extra services that can be added to the ev...
asked by 24.07.2014 / 12:47
2
answers

How to add a class to a li when the person is on the link page accessed?

I'm creating a site using PHP with includes for better maintenance, however I'm having a problem. If I used only HTML this problem would not be occurring, as I'm using includes to pull menu , I can not add a clas...
asked by 23.07.2014 / 01:16
1
answer

How to pass arguments to a PHP script via command line?

I have a PHP script that takes arguments as follows: script.php -f "valor" . How do I get PHP to pass this argument via the command line?
asked by 26.03.2014 / 14:25
2
answers

How to modify menu title of a plugin in wordpress?

I have a problem modifying the title of my plugin in the menu, I need the main title to be different from the second title, but I can not. As in the image: My Code: public function menu(){ add_menu_page('Gallery', __('Gallery', '...
asked by 24.03.2014 / 21:23
1
answer

Twig and Namespaces

Hello, I'm having a hard time implementing Twig in my project MVC , I'm using namespaces, autoloader all that PSR-0 thing. I'd like your judah to implement because I'm almost freaking out. rs public function render($file, $...
asked by 23.03.2014 / 05:56
1
answer

How to compare the value of numbers saved as VARCHAR in mySQL?

I have a table named coordenadas_cache , with 6 fields: codigo (int, auto increment), latitude_sul (VARCHAR(10)), latitude_norte (VARCHAR(10)), longitude_oeste (VARCHAR(11)), longitude_leste (VARCHAR(11)), endereco (VARCHAR(80)) In it...
asked by 04.04.2014 / 03:35
3
answers

Calculation of percentage of growth

I have three columns that would be month , revenue and expenses . For example: Mês | Receita | Despesas Janeiro | 2500 | 1000 Fevereiro | 1000 | 500 I would like to demonstrate the percentage growth using PHP and MySQL....
asked by 04.04.2014 / 00:43
2
answers

Error "Undefined variable"

I'm trying to run this code but it's not working. $sql = "SELECT * FROM cliente WHERE id = $id "; $limite = mysql_query("$sql"); while ($sql = mysql_fetch_array($limite)){ $nome = $sql["nome"]; $telefone = $sql["telefone"]...
asked by 27.02.2015 / 08:00
2
answers

Dynamically creating id's

I'm currently creating the element this way: $ss = '<input id="link" class="link[]" title="SS" type="image" src="../cancel.png"/>'; My JS, looks like this: $("#link").click(function(){ alert("SIM"); }); I'm currently runn...
asked by 02.03.2015 / 19:25