Questions tagged as 'php'

1
answer

Different numbers become equal after conversion with doubleval [closed]

I have 2 values 4850.00 and 4850.01 When I define 2 variables manually with these values and compare using if , it returns me different (OK). But in an ERP system I develop I get 2 values via AJAX. Both the same values above and even...
asked by 07.08.2015 / 20:01
2
answers

Every class must have a constructor [duplicate]

I know it's a beginner's doubt, but I need to heal that doubt. I searched the internet and sites do not always come into "agreement". Does every class need to have a constructor? Example: I can make the student class and have no const...
asked by 17.08.2015 / 19:18
2
answers

mysqli_select_db () expects parameter 1 to be mysqli, string given [duplicate]

I have a problem here with Mysql, it is giving errors, I have made all kinds of changes. I have tried to change the Mysql function to Mysqli and only increase errors. Code: <?php $sql["host"] = "localhost"; $sql["usuario"] = "ro...
asked by 29.10.2017 / 14:41
3
answers

Transform into function

I have this code that brings the user data into my database: $resultado = mysqli_query($conexao, "select * from usuarios where id= {$id}"); $dado = mysqli_fetch_assoc($resultado); echo $dado['nome']; echo $dado['sobrenome']; How do I make...
asked by 05.11.2017 / 13:24
2
answers

Try / Catch PDOException does not work when error occurs

I created the following method to execute my querys: public function setQuery($query) { try { $stmt = self::$conn->prepare($this->limpaQuery($query)); return $stmt->execute(); } catch (PDOException $Exception)...
asked by 12.11.2017 / 01:03
2
answers

Collecting words from an input

I'm developing a (study-only) page for a bookstore. The variable titulo_livro receives the data of a input type='text' . What do I need to do: The title of the book will often contain more than one word. How do I collect these...
asked by 22.12.2017 / 18:42
2
answers

With or without Wordpress [closed]

Good afternoon, I'm working ... well, actually studying PHP and would like to work with Brazilian laws. I know the work is hard, though, but I am slowly getting it. But I do not know if I use wordpress as the base of the site or if I only...
asked by 18.05.2015 / 22:08
3
answers

Check Availability of Zip Code

I'm trying to develop but I'm not familiar with programming with Ajax , jQuery and JavaScript , so I'd like help I have a field that takes the customer's zip and a button so that when he clicks the return button if that zip is covered th...
asked by 07.11.2017 / 22:40
2
answers

How to transform strotime output into a variable

I'm trying to use this script , which returns every Monday between two periods: $beginday = isset($_POST["Tinsem3"]) ? $_POST["Tinsem3"] : false; $lastday = isset($_POST["Tdesl"]) ? $_POST["Tdesl"] : false; $lastday = strtotime($lastday); f...
asked by 14.05.2015 / 19:12
2
answers

Pass each result of an array to a variable

I have this loop that lists all the rows in the array , but I only need some rows. How to pass each result to a variable? $WS->key='00000000000'; // Atenção: Este parâmetro possui valores diferentes // Chamada do método e retorno da res...
asked by 03.05.2015 / 20:00