1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Using PHP "Variable" in SQL Statement

Discussion in 'MySQL' started by LindseyInteractive, Dec 27, 2011.

  1. #1
    Okay, I am trying to use a "Variable" in a SQL Statement, but I keep getting errors when I do it.

    Here is the current one, that works perfectly fine:

    But then I try to do a variable in the place of service_name="SEO Budget Package"'; and I get errors, here is what I try to do:

    I would think it would be the same thing but it gives me a :

    Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\sismedia\orders\fetch.php on line 17SEMrush
    Solved! View solution.
    LindseyInteractive, Dec 27, 2011 IP
  2. #2
    look here:
    $sql="SELECT * FROM services WHERE service_name='$variable' ";
    gapz101, Dec 27, 2011 IP
    SISMediaGroup likes this.
  3. LindseyInteractive

    LindseyInteractive Well-Known Member

    Likes Received:
    Best Answers:
    Trophy Points:
    Thank you alot Gapz101.
    LindseyInteractive, Dec 27, 2011 IP