Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    WHERE keyword to my query

    Hi,
    I have a query like below

    $query = "SELECT id,event_id,dayNo,themeName,sessionTime,sessionTopic from agenda WHERE event_id='4' AND dayNo='2'";

    I don't want to use the same query for all requests.How can i add the WHERE keyword to my query only if the required parameters are passed to my service. I can change query at runtime.

    Thanks in advance

  2. #2
    New Coder
    Join Date
    Oct 2010
    Posts
    99
    Thanks
    10
    Thanked 1 Time in 1 Post
    If I understand what you mean, you want different queries based on user input. That can be done by a simple if statement in your php.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •