Results 1 to 4 of 4

Thread: Need Help with Custom SQL Statments

  1. #1
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Need Help with Custom SQL Statments

    ok guys here is the biggy

    I have an aspx page in it there is a datalist and to it i would like to connect a textbox and 2 dropdown lists

    this is a school project where i have the datalist display movies and its connected to a database where there is a directorFirstName and ActorFirst Name

    what i want is when someone enters for example John and pulls down from the dropdown Actor it would show info on the datalist the movis that John Travolta was in

    What i am looking for is a custom SQL statment to do this

    Please and thank you

  2. #2
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    i suggest you check out the MySQL website for details on how to construct a query. Assuming you are using MySQL

    Sample MySQL query
    Code:
    SELECT *  FROM `movies` WHERE `actor` LIKE CONVERT(_utf8 '%john%' USING latin1) COLLATE latin1_swedish_ci;
    Ryan
    Sevierville, TN

  3. The Following User Says Thank You to NXArmada For This Useful Post:

    Mehok (03-13-2008)

  4. #3
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    ok i dont think this is right

    John is enterd by the user and actor is one of the options on a dropdown list

  5. #4
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Basically you have to extract whatever the user enters in the form field using your server-side part. After storing the values in some variables you can construct an SQL statement like the above one and instead of specifying 'john' directly in the above statement you have to fill it from your variable.

Bookmarks

Posting Permissions

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