Professional Web Applications Themes

newbie needs help with mysql query from a form submission - MySQL

Hi guys. I have a simple form which has countries to choose from. Once a country is chosen I need to do a select lookup. I can't find the correct symbol for "all" countries in the lookup i.e can someone tell me what I should palce instead of the ? in the following country to lookup all select all countries : SELECT * FROM database WHERE country=? Thank you in advance, Raj (newbie)...

  1. #1

    Default newbie needs help with mysql query from a form submission

    Hi guys. I have a simple form which has countries to choose from. Once a
    country is chosen I need to do a select lookup. I can't find the correct
    symbol for "all" countries in the lookup i.e can someone tell me what I
    should palce instead of the ? in the following country to lookup all select
    all countries :

    SELECT * FROM database WHERE country=?

    Thank you in advance,

    Raj (newbie)

    raj Guest

  2. #2

    Default Re: newbie needs help with mysql query from a form submission

    On 15 Mar, 13:34, raj <com> wrote: 


    SELECT * FROM database

    Captain Guest

  3. #3

    Default Re: newbie needs help with mysql query from a form submission

    On Thu, 15 Mar 2007 13:34:05 +0000, raj wrote: 

    = comparisons can't do wildcards. LIKE comparisons can.

    SELECT * FROM my_table WHERE country LIKE '%';

    will pick all.

    SELECT * FROM my_table WHERE country LIKE 'NZ';

    will pick just rows in New Zealand.

    SELECT * FROM my_table WHERE country LIKE '%X';

    will pick all the country codes ending in X.

    --
    23. I will keep a special cache of low-tech weapons and train my troops in
    their use. That way--even if the heroes manage to neutralize my power
    generator and/or render the standard-issue energy weapons useless--my
    troops will not be overrun by a handful of savages armed with spears.
    Peter Guest

  4. #4

    Default Re: newbie needs help with mysql query from a form submission

    On 15 Mar, 14:07, "Peter H. Coffin" <com> wrote: 
    as will SELECT * FROM my_table

    Captain Guest

Similar Threads

  1. If then statement / mysql query: NEWBIE
    By phatnugs420@comcast.net in forum PHP Development
    Replies: 1
    Last Post: August 11th, 10:18 AM
  2. newbie: MySQL query results
    By Amgine in forum PHP Development
    Replies: 0
    Last Post: October 20th, 03:24 AM
  3. Form submission fills form values with garbage
    By ratlhead in forum PHP Development
    Replies: 5
    Last Post: September 27th, 05:20 AM
  4. problem with a mysql query with data from a form
    By Vincent Fievet in forum PHP Development
    Replies: 3
    Last Post: August 29th, 01:15 PM
  5. Form and image submission query.
    By Beowulf in forum PHP Development
    Replies: 5
    Last Post: July 10th, 06:03 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