I have a select statement like.....
(1) $today = date('D, d M, Y');
$sql = "SELECT * FROM tables WHERE date = '$today'";
Its working fine and getting the output....
And I have an input field in the same page like....
<form method="post">
<input type="text" id="dt1" onchange="this.form.submit()" name="dt1" value="dt1"/>
</form>
And this input joined with a datepicker....
My aim is show today's data and while changing the datepicker show data on the particular date in the same page....
I given the select statement for this input is....
(2) $mydt = my开发者_如何学编程sql_real_escape_string($_POST['dt1']); $sql = "SELECT FROM tables WHERE date = '$mydt'";
Independently (1) and (2) are working fine...
How will I join (1) and (2)...
That means I want to get todays data and while changing date picker i want to show that particular data of that date....
Your question is a little bit confusing but I think what you need is this:
SELECT * FROM tables WHERE date = '$today' OR date = '$mydt';
精彩评论