Order query and place function fixed. 
Initial sql data for order.