Professional Web Applications Themes

select query question for MySQL 3.23 - MySQL

Greetings All, I'm struggling with this one. I'm trying to structure a query for MySQL 3.23. SELECT * FROM jos_liveshoutbox_temp WHERE id > "20" AND name="me" OR name="cathy" What I need to get is * WHERE id's > "20" from "me" and from "cathy". What I'm getting from the above query is only * from "cathy". It would be great if you could work MySQL queries like math: SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy" OR name="client") Does anybody have any solution? I'm working with MySQL 3.23. Please don't feel sorry for me. Regards, Luc M. Forget...

  1. #1

    Default select query question for MySQL 3.23

    Greetings All,

    I'm struggling with this one.

    I'm trying to structure a query for MySQL 3.23.

    SELECT * FROM jos_liveshoutbox_temp WHERE id > "20" AND name="me" OR
    name="cathy"

    What I need to get is * WHERE id's > "20" from "me" and from "cathy".
    What I'm getting from the above query is only * from "cathy".

    It would be great if you could work MySQL queries like math:
    SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
    OR name="client")

    Does anybody have any solution?

    I'm working with MySQL 3.23. Please don't feel sorry for me.

    Regards,
    Luc M. Forget

    stat_holyday@hotmail.com Guest

  2. #2

    Default Re: select query question for MySQL 3.23

    On 10 Jul, 04:16, com wrote: 

    As far as I can se from the manual you can do:

    SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
    OR name="client")

    What happens when you try it?

    If it does fail, simply multiply out the brackets thus:

    SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND name="cathy"
    OR id > "21" AND name="client"

    Captain Guest

  3. #3

    Default Re: select query question for MySQL 3.23

    Greetings, thanks for your response. I'm using phpMyAdmin 2.2.3 as an
    interface, and as far as I can tell I'm getting a "Your SQL-query has
    been executed successfully" response, but with no results... I've
    tried both your recomendations, plus a few dozen variation, and still
    nothing.... I'm bummed out.

    Still looking for clues,
    Luc M. Forget


    On Jul 10, 1:42 am, Captain Paralytic <com> wrote: 








    >
    > As far as I can se from the manual you can do:
    >
    > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
    > OR name="client")
    >
    > What happens when you try it?
    >
    > If it does fail, simply multiply out the brackets thus:
    >
    > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND name="cathy"
    > OR id > "21" AND name="client"[/ref]


    stat_holyday@hotmail.com Guest

  4. #4

    Default Re: select query question for MySQL 3.23

    == Quote from stat_holyday ( com)'s article 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > >
    > > As far as I can se from the manual you can do:
    > >
    > > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
    > > OR name="client")
    > >
    > > What happens when you try it?
    > >
    > > If it does fail, simply multiply out the brackets thus:
    > >
    > > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND name="cathy"
    > > OR id > "21" AND name="client"[/ref][/ref]

    try this:
    SELECT * FROM jos_liveshoutbox_temp WHERE id > 21 AND (name="cathy" OR name="client")

    no double quotes around id.
    --
    POST BY: lark with PHP News Reader
    lark Guest

  5. #5

    Default Re: select query question for MySQL 3.23

    Wow... that was an easy solution. Never dawned on me... I have to
    remember that little trick they call "convention". Many, many thanks
    lark!

    Regards,
    Luc M. Forget

    On Jul 10, 7:02 am, lark <net> wrote: [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    >
    > try this:
    > SELECT * FROM jos_liveshoutbox_temp WHERE id > 21 AND (name="cathy" OR name="client")
    >
    > no double quotes around id.
    > --
    > POST BY: lark with PHP News Reader[/ref]


    stat_holyday@hotmail.com Guest

Similar Threads

  1. Replies: 4
    Last Post: July 30th, 02:02 AM
  2. MySQL Select query question
    By goldstein in forum Dreamweaver AppDev
    Replies: 4
    Last Post: September 29th, 01:40 PM
  3. Mysql select query with php
    By Benjamin Dickgießer in forum PHP Development
    Replies: 7
    Last Post: November 20th, 10:57 PM
  4. mysql select query with unusual criteria fails
    By Phil Powell in forum PHP Development
    Replies: 1
    Last Post: October 20th, 07:47 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139