java - How to find data between two different dates? -


i want find data between 2 dates , display results in table.

below code doesn't work.

ps = dbconnection.cn.preparestatement("select bill_no, date, cust_name, contact_no, reg_no, model, cc, qty, engine_no, chasis_no, payment_mode, grand_total  stock date = '$from' , '$to' "); 

you should use between operator:

select bill_no, date, cust_name, contact_no, reg_no, model, cc, qty, engine_no, chasis_no, payment_mode, grand_total     stock  date between '$from' , '$to' 

mandatory comment:
using string replacements leaves code vulnerable sql injection attacks. should consider using prepared statements instead.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -