Database search

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • voidmain
    New Member
    • Jun 2007
    • 1

    Database search

    hi,

    I have an application that searches database for a numerical field. Lately, i have been learning Ajax and I want to write a sql statement to search based on keys entered.

    For eg,
    Code:
    SELECT * from tbldata where productNumber LIKE '" & value_from_querystring &"'%", dbconn, 3, 3
    But when i run this statement, it gives me an error, saying there's a problem with syntax near ','.

    I am confused.
    Last edited by jhardman; Jun 1 '07, 03:11 PM. Reason: put code in code tags
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    try:
    Code:
    query = "SELECT * from tbldata where productNumber LIKE %" & value_from_querystring &"%", dbconn, 3, 3
    (I took out the single quotes and put the percent on both sides)

    Jared

    Comment

    Working...