problem with php mysql query


Posted on 16th Feb 2014 07:03 pm by admin

Hi guy's...

I'm totally lost here..because don't have any idea how to make a query for grab record using BETWEEN startdate and enddate since existing record are stored using this format datetime(dd/mm/yyyy hh:mm:ss) but my supplied $startdate and my $enddate are in this format date(dd/mm/yyyy) only....hope someone will shed me some light on this...is it possible to grab those record...??

Code: //example of my query..

$sqlquery = "SELECT * FROM sometable WHERE OFFENCE_NOTICE_STATUS = 'A' AND CREATED_DATE BETWEEN ".$start_date." AND ".$end_date;

//can't run this query because of the stored record in database are in different format datetime(dd/mm/yyyy hh:mm:ss)

//my supplied variable in date(dd/mm/yyyy) format...


Any help are appreciated TQ..

No comments posted yet

Your Answer:

Login to answer
348 Like 35 Dislike
Previous forums Next forums
Other forums

Allegro crashes when running load_bitmap. Why?
I can not get Allegro to load any BMP images. Here is a section of test code. The picture is in the

php automatically escaping single quotes
I'm trying to test out my security a bit and I've noticed that php is escaping my single quotes. For

Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does

Text Not Displaying Correctly With PHP:GD
I recently moved servers and since then I have noticed that one line of text is showing weirdly.

that old Malformed Headers problem again!!!!! HELP!!!!!!
I've read the http://www.phpfreaks.com/forums/index.php/topic,37442.0.html

I don't think my c

Ajax Error since Upgrading to 3.5
Ever since upgrading my site to .NET 3.5 (I needed LINQ), I've been getting this annoying error on o

Inserting 100x and 100y coordinates in mysql table - easy
Is there a way to insert this data into a mysql table named 'map' with the fields: 'x int 3' , 'y in

Create comparison matrix?
I want to create a comparison script for forum software and was wondering is there any tutorial or b

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash