Questions tagged as 'php'

3
answers

Check if a date is earlier than another date

Good morning, I would like to know if there is a way to check if one date is earlier or higher than another, in my code there are 2 date type inputs, which send their values to the database, however a date will start something and the other end,...
asked by 08.06.2016 / 13:30
2
answers

Regex - Operator "." - Capture of meta character

Situation I'm doing a search with regex in a specific word inválido , but by preference I decided to use inv.lido . Which I knew I had in the test string, but did not return. Tests vr = var_dump...
asked by 20.08.2015 / 15:29
2
answers

Return 0 when SUM is NULL

When it does not find results it returns NULL , how can I do for the search return me 0 when NULL ? SELECT SUM(coluna1 + coluna2 + coluna3) FROM table WHERE nome='funalo' AND MONTH(data) = 09 AND YEAR(data) = 2018     
asked by 10.08.2018 / 15:27
3
answers

Verify that a record was deleted when executing DELETE query

I'm doing a simple PHP code to delete database email, but I need to use if and else if a given action occurs. If, for example, deleting an email displays a certain message, or if it does not have the requested email in the datab...
asked by 19.10.2015 / 02:28
2
answers

Ternary Operator, is_array, unexpected

See only .. Follow the instruction $var = 123; echo "valor de var: " . is_array($var) ? implode("-",$var) : $var; Ai gives the following error: implode(): Invalid arguments passed . I expected that the implode function would not b...
asked by 10.09.2015 / 04:56
3
answers

How to stick with only one part of the string? [duplicate]

I have several string's (id-question-18, id-answer-18, id-question-17, id-answer-17) I needed to just write (id Question, id Answer, id question, id answer) How do I do in PHP? The goal is as follows: At this point I have the follow...
asked by 27.10.2015 / 17:11
3
answers

mysqli_escape_string () expects exactly 2 parameters, 1 given

I'm experiencing an error in my code, when I run the DW c6 server behavior, when I move from mysql_ to mysqli_ , I get an error in the function executed on line 10. The error is:    Warning: mysqli_escape_string () expects exa...
asked by 21.09.2015 / 17:06
2
answers

while listing result of 4 in 4 within div

How do I list the result of a sql query so that a 4-by-4 line is inside a div. Ex. expected result: <div class="row"> <span>1</span> <span>2</span> <span>3</span> <span>4</s...
asked by 12.12.2015 / 18:42
2
answers

How to sort a table from A to Z?

I have an HTML table that brings information from the database. I would like to know if there is any way to sort from A to Z and vice versa and vice versa by clicking on the name of the column in the table? This data is not fixed, it is dy...
asked by 24.05.2016 / 18:52
2
answers

How to transform an INI file into an Array? [duplicate]

How can I transform a INI file into a array into PHP? Example: [database] host = localhost password = sabe_de_nada_inocente port = 3306     
asked by 30.09.2016 / 19:51