Results 1 to 3 of 3

Thread: SQL Query

  1. #1
    Join Date
    Mar 2011
    Posts
    3

    Cool Unanswered: SQL Query

    Hello,

    Can someone please help me figure this out?

    I can make a query like so....

    "SELECT * FROM ACCOUNT WHERE ID = '1.3.500'"

    but for some reason, this query is not working:

    $account = 1.3.500;

    "SELECT * FROM ACCOUNT WHERE ID = " . $account;

    what am I doing wrong? is there another format to query using a variable?

    Thanks!!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    looks like you forgot the single quotes

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2011
    Posts
    3
    Thanks! Here's how i got it to work:

    "SELECT * FROM ACCOUNT WHERE ID = '$account'";

Posting Permissions

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