Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    178
    Rep Power
    83
    Originally Posted by jblevins1991
    this did not work either. I went back to using the brackets.
    Something from left field. Does variable $table contain anything?

    Try echoing $sql.
    PHP Code:
    $sql "SELECT value1 FROM {$table} WHERE value=\":value\"";  

    echo 
    $sql
  2. #17
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    14
    Rep Power
    0
    Originally Posted by BarryG
    Something from left field. Does variable $table contain anything?

    Try echoing $sql.
    PHP Code:
    $sql "SELECT value1 FROM {$table} WHERE value=\":value\"";  

    echo 
    $sql
    Yes, the table im querying is called values.
  4. #18
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    14
    Rep Power
    0
    i figured it out.

    In the query i had to change the \":email\" to :email.

    Thank you for trying to help me it was appreciated.
  6. #19
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    178
    Rep Power
    83
    Originally Posted by jblevins1991
    Yes, the table im querying is called values.
    I just took a look at the php manual for PDO:repare an PDO::bindValue. there are no quotes around the placeholder.
    Try this.

    PHP Code:
    $sql "SELECT value1 FROM {$table} WHERE value=:value"
    You found it while I was typing!! Good on ya!
  8. #20
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    14
    Rep Power
    0
    Originally Posted by BarryG
    I just took a look at the php manual for PDO:repare an PDO::bindValue. there are no quotes around the placeholder.
    Try this.

    PHP Code:
    $sql "SELECT value1 FROM {$table} WHERE value=:value"
    You found it while I was typing!! Good on ya!
    Darn MySQL engineers. They think they are so sneaky lol.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo