+ Reply to Thread
Results 1 to 2 of 2

Thread: heeeeeeeeeeelllllppppppppppp!!!!!!

  1. #1
    lordsofvine is offline x10Hosting Member lordsofvine is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    41

    heeeeeeeeeeelllllppppppppppp!!!!!!

    Parse error: syntax error, unexpected T_STRING in C:\wamp\www\xampler\phpadd.php on line 10

    <?php
    $con = mysql_connect("localhost","root","");
    if ($con)
    {
    die('Could Not Connect: ' . mysql_error());
    }

    mysql_select_db("my_db, $con);

    $sql="INSERT INTO person (FirstName, LastName, Age)
    VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";

    if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }
    echo "1 record added";

    mysql_close($con)
    ?>

    ---------------------------------------

    <html>
    <body>

    <form action="phpadd.php" method="POST">
    Firstname: <input type="text" name="firstname" />
    Lastname: <input type="text" name="lastname" />
    Age: <input type="text" name="age" />
    <input type="submit" />
    </form>

    </body>
    </html>


    can anyone check whats wrong........ thanks so much

  2. #2
    TheMan177 is offline x10 Sophmore TheMan177 is an unknown quantity at this point
    Join Date
    Jan 2008
    Posts
    179

    Re: heeeeeeeeeeelllllppppppppppp!!!!!!

    PHP Code:
    mysql_select_db("my_db, $con); 
    Should be:

    PHP Code:
    mysql_select_db("my_db"$con); 

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers