Web Analytics Made Easy -
StatCounter select problem - CodingForum

Announcement

Collapse
No announcement yet.

select problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • select problem

    Hello...

    I have a DB with 50,000 entries. I have a search form to search through the DB. If the recno=30123456 and you search the recno, you get that one file. what if i want a query that searches alll recno's that contain 30?? Can I do that using mysql or do I need to program that in my java app??

    Thank you

    Tony
    ---------
    Client / Server Side Programmer II

  • #2
    Whis example would help you
    Code:
    SELECT * FROM table WHERE recno LIKE '30%'
    Free php image upload script
    Personal web developing blog

    Comment


    • #3
      can they contain 30 anywhere in the value? if so use the example above. If you only want ones that start with 30 use
      Code:
      columname like '30%'
      the difference is if you are looking from the beginning of the string your query will use an index. when your query starts with % will not use an index and will be significantly longer.

      Comment


      • #4
        thank you !! I really appreciate your help =)
        ---------
        Client / Server Side Programmer II

        Comment

        Working...
        X