MySQL Forums
Forum List  »  Newbie

Re: How to query for rec's WHERE >= $start_date ?
Posted by: Peter Brawley
Date: December 29, 2017 10:13PM

Why in the world are there backticks in the date string? Instead of removing them, fix the process that adds them in.

A date value sent to a url as an argument would be something like ...

https://www.myscript.php?arg1=val1&date=2017-12-10

... so myscript.php would have code like this ...

$conn = mysqli_connect( ... );
...
$date = ( isset($_GET['date']) && !empty($_GET['date']) ) ?
        mysqli_real_escape_string( $conn, $_GET['date'] ) : 
        "";
if( strtotime($date)==0 ) exit "Invalid date" );

Options: ReplyQuote


Subject
Written By
Posted
Re: How to query for rec's WHERE >= $start_date ?
December 29, 2017 10:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.