Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Less than equal to query in codeigniter

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 4.99k
    Comment on it

    Hello reader's If you are using codeigniter and want to make '<=' mysql query then you can use the code syntax as below:-

    1. ->select('COUNT(payment.keyid) AS rec_count')
    2. ->where('payment.paymentdate >=', $month_start)
    3. ->where('payment.paymentdate <=', $month_end)
    4. ->get()

    here you just have to add the line

    1. ->where('payment.paymentdate >=', $month_start)

    And similarly you can make joins or ordery by clauses also as example below:-

    1. ->select('product_key.client_name, product_key.contact_email, product_key.status, product_key.id, payment.paymentdate, (payment.id) as pid,payment.subscription_type')
    2. ->from('product_key')
    3. ->join('payment', 'payment.keyid=product_key.id', 'left outer')
    4. ->where('status', 'purchased')
    5. ->order_by('client_name', "asc")
    6. ->group_by('product_key.id')

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: