SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: mySQL

  1. #1
    psycho
    Join Date
    May 2000
    Location
    London
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can i use variables in mySQL requests ? I get a mySQL error when i use this in my PHP :

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    $result2 = mysql_query(
    "SELECT reviewtext FROM lps where ID=$row[id]");
    if (!$result2) {
    echo("&lt;P&gt;Error performing query: " .
    mysql_error() . "&lt;/P&gt;");
    exit();
    }
    [/code]

    cheers
    -j

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the error you got?

    There are thousands of possible errors...so we need to know a bit more to help you.

    But yes you can use PHP variables in mySQL queries.

  3. #3
    psycho
    Join Date
    May 2000
    Location
    London
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its OK, I've sorted it out now. thanks for the reply anyway.

  4. #4
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure, no problem. It would've been nice to help someone though.

    Anyways good luck with PHP and mySQL and I'll try to help you faster next time


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
  •