Results 1 to 2 of 2

Thread: Error in mysql query with array value

  1. #1
    Join Date
    Nov 2011
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Error in mysql query with array value

    Hi

    I did explode on price range values.

    It gave me two values.

    But I am not able write those values in mysql query.

    How will i write query with those two exploded values

    Code:
    $query = "select * from table where price BETWEEN $pricerange[0] and $pricerange[2]";
    This is giving me error

    Thanks
    Vineet

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,375
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    I don't know all of what you're talking about. But are you sure you want to skip [1]? You said you have two values. Unless [1] is a garbage value or otherwise to be ignored, perhaps [2] is undefined. Also check for proper spelling of $pricerange, if that's misspelled/spelled differently here compared to where it's first made and/or used at a prior point to this, that could be a problem

    If none of that's it, please post the error you're getting - it might help me or another figure this out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. mysql query error ...
    By pepe_lepew1962 in forum MySQL and other databases
    Replies: 5
    Last Post: 09-21-2011, 08:09 PM
  2. MySQL:Is any error with this query
    By leonidassavvides in forum MySQL and other databases
    Replies: 0
    Last Post: 11-06-2009, 11:30 PM
  3. Need help with MySQL query...
    By vern1271 in forum MySQL and other databases
    Replies: 0
    Last Post: 08-06-2008, 03:51 PM
  4. MySQL Error In Query
    By tomyknoker in forum MySQL and other databases
    Replies: 1
    Last Post: 04-17-2007, 02:12 AM
  5. mySQL query?!
    By nikomou in forum MySQL and other databases
    Replies: 3
    Last Post: 03-11-2007, 03: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
  •