Parse error: parse error, unexpected $ in...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nazgul42
    New Member
    • Jul 2007
    • 12

    Parse error: parse error, unexpected $ in...

    I am writing a very simple login script for a website that I am also writing, but when I try to run it, the only error I get is:
    Parse error: parse error, unexpected $ in /home/www/zammarket.freeh ostia.com/signup.php on line 22
    Line 22 is the last line in the file.
    My code is here:
    [PHP]
    <?php
    echo "Starting.. .";
    @mysql_connect( My_Sql_Server, My_DB, My_Password) or die("Cannot Connect To DB!");
    @mysql_select_d b(My_DB) or die("Cannot Select DB!");
    echo "Connected! ";
    $sql = "INSERT INTO users (username, password, rsusername) VALUES('" .
    $_POST['Username'] .
    "','" .
    $_POST['Password'] .
    "','" .
    $_POST['RSUsername'] .
    ');";
    echo "SQL Statement Written";
    $r = mysql_query($sq l);
    echo "Query Performed";
    if(!$r) {
    echo "Error!"
    $err=mysql_erro r();
    print $err;
    exit();
    }
    ?>
    [/PHP]
    the My_SQL_Server, My_DB, and My_Password are all replaced with the proper values.
  • nazgul42
    New Member
    • Jul 2007
    • 12

    #2
    Never Mind, I fixed it by changing line 12:
    ');";
    to:
    "');";
    and line 17:
    echo "Error!"
    to:
    echo "Error!";

    Comment

    • ak1dnar
      Recognized Expert Top Contributor
      • Jan 2007
      • 1584

      #3
      Thanks for sharing the solution with the others.
      best of luck!
      -Ajaxrand

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya nazgul.

        Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)

        Thanks for posting the solution, too.

        Comment

        Working...