sitorush Posted July 3, 2007 Share Posted July 3, 2007 hello friends, whats the correct format of query string below: $query = 'Select * from datersv where $ci BETWEEN datersv.date_in AND datersv.date_out OR $co BETWEEN datersv.date_in AND datersv.date_out'; Thank you.. Quote Link to comment https://forums.phpfreaks.com/topic/58216-solved-query-string/ Share on other sites More sharing options...
HuggieBear Posted July 3, 2007 Share Posted July 3, 2007 If you mean how should it be formatted, I'd go for this, although you haven't specified which database you're using, so I can't confirm if the syntax is exactly right. <?php $query = "SELECT * FROM datersv WHERE (" . $ci . " BETWEEN datersv.date_in AND datersv.date_out) OR (" . $co . " BETWEEN datersv.date_in AND datersv.date_out)"; ?> Regards Huggie Quote Link to comment https://forums.phpfreaks.com/topic/58216-solved-query-string/#findComment-288686 Share on other sites More sharing options...
sitorush Posted July 3, 2007 Author Share Posted July 3, 2007 yes it works now. thank you very much.. Quote Link to comment https://forums.phpfreaks.com/topic/58216-solved-query-string/#findComment-288700 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.