You have an error in your SQL syntax; check the manual that corresponds to your MySQL

Discussion in 'MySQL' started by kysper, Sep 28, 2012.

  1. #1
    This site used to work, since i suddenly get this error.

    Could you please help me?

    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id =' at line 1

    <?

    include ("../inc/****.inc.php");
    include ("../inc/*****.inc.php");

    $seite = "Direkt";


    ###################################################################################

    $ip = $_SERVER['REMOTE_ADDR'];

    $kriterium = "objekt";
    $auswahl = $objekt;

    $strsql7 = " SELECT * FROM user_ip";
    $strsql7 .= " WHERE ip = '".$ip."' ";
    //echo "strsql_select_7: ".$strsql7."<br>";
    $handle7 = mysql_query($strsql7,$connect);
    $row7 = mysql_fetch_array($handle7);
    $seiten_alt = $row7[seiten];
    //echo "seite[]: ".$row7[seite]."<br>";
    //echo "seiten_alt: ".$seiten_alt."<br>";

    $strsql_a = " UPDATE user_ip ";
    $strsql_a .= " SET seiten = '".$seiten_alt."<br> ".$land." / ".$objekt."' ";
    $strsql_a .= " WHERE ip = '".$ip."' ";

    //echo "strsql_a: ".$strsql_a."<br>";
    $handle_a = mysql_query($strsql_a,$connect);


    Thanks for your help!!!
     
    kysper, Sep 28, 2012 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Uncomment "//echo "strsql_a: ".$strsql_a."<br>";" and post what it outputs.
     
    jestep, Sep 28, 2012 IP