Questions tagged as 'php'

1
answer

Return amount of PHP Array responses

I have the following array (): Array ( [0] => stdClass Object ( [men_id] => 3 [usu_id] => 2 [usu_destino] => 2 [id_resposta] => 0 [usu_respondeu] => 0...
asked by 19.11.2017 / 13:57
1
answer

Remove duplicate values from an array - php

I need to remove the duplicate values from a php array, for example: $array = ('2015', '2015', '2012', '2013', '2014', '2014', '2016') I wish I had the output: Array ( [0] => 2012 [1] => 2013 [2] => 2016 ) Everything that is d...
asked by 22.11.2017 / 18:56
1
answer

Value of one of the array fields

I need to check the value of one of the fields in an array but I can not. var_dump($array_exemplo); array(1) { [0]=> array(3) { ["primeiro"]=> string(1) "1" ["segundo"]=> string(1) "2" ["terceir...
asked by 15.11.2017 / 14:20
1
answer

How to send data with JS? no page refresh

I'm trying to create an HTML Game and need a way to send data to a database (MYSQL) and would like to know how I can send site data to a server without the page refreshing. If anyone knows some libraries I can use to develop a 2D game in html...
asked by 21.11.2017 / 04:18
2
answers

Using JSON in JQuery library

I'm using the "Vegas Background SlideShow" library in a project with the following code: <script> $("#main").vegas({ slides: [ { src: "assets/site/img/uploads/banners/01.jpg" }, { src: "assets/site/img/uploads...
asked by 10.09.2016 / 23:48
1
answer

Calling a function in Views in codeigniter

I have this function in models : function sumContasReceber() { $this->db->select('lancamentos.*'); $this->db->from('lancamentos'); $somaCR = "SELECT SUM(valor) as SOMACR FROM lancamentos where baixado...
asked by 10.09.2016 / 23:03
1
answer

Viewing birthdays for the current month in FullCalendar

I have a database with a date in the field start , I would like to display only the birthday of the current month in fullcalendar , but I have two difficulties: Select only the birthdays of the current month Show birthdays i...
asked by 16.09.2016 / 20:46
1
answer

Is it possible to implement an abstract class in PHP without the need for inheritance like in Java?

It is possible to do in PHP "in the same way" the instance of class CachorroAbstract in method main below: public abstract class CachorroAbstract { public abstract void latir(); } public class Main{ public static void mai...
asked by 04.07.2016 / 22:47
1
answer

MySQL giving error only when I use query via variable

I'm trying to save an information in my database with the following functions: $sql = $request[0]; $query = $this->conn->prepare($sql); $query->execute(); $ sql var_dump: string(322) "INSERT INTO Fornecedor (razao_social, nome_fa...
asked by 08.07.2016 / 14:38
1
answer

error when comparing sha1 in php

I am doing a login system but comparing the password that the user typed with the one that is in the error database. When the user registers in the system applies two sha1 type: sha1(sha1($_POST['senha'])); But when I compare so...
asked by 08.07.2016 / 21:15