Results 1 to 8 of 8

Thread: [RESOLVED] MySQL: Query with more than one id(s)

  1. #1

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Resolved [RESOLVED] MySQL: Query with more than one id(s)

    how can you make MySQL get results relating to more than 1 id(s)(say like 5, 45, 6)
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: MySQL: Query with more than one id(s)

    select * from table_name where id = 5 or id = 45 or id = 6

  3. #3

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Re: MySQL: Query with more than one id(s)

    that was what i first tried when i needed to do this in the first place but it returned no results.
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  4. #4
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: MySQL: Query with more than one id(s)

    Are the ID's string or numerical data type in the database?

  5. #5
    Lively Member {yak}'s Avatar
    Join Date
    Aug 2005
    Posts
    119

    Re: MySQL: Query with more than one id(s)

    Or, where id in(5, 45, 6). If it doesn't work you'll have to give us more to go with.
    {yak}

  6. #6

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Re: MySQL: Query with more than one id(s)

    sorry for replying late...
    Quote Originally Posted by kfcSmitty
    Are the ID's string or numerical data type in the database?
    the id's are numerical in the database.
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  7. #7
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: MySQL: Query with more than one id(s)

    reply #2 and reply #5 both give you a solution.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  8. #8

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Re: MySQL: Query with more than one id(s)

    yes it does... thanks
    just wanted to reply to kfcSmitty's post
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

Posting Permissions

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



Click Here to Expand Forum to Full Width