Sign in to follow this  
game mercenary

[web] php/mysql help

Recommended Posts

<?php $name = "theev2"; $pass = "pass"; $db = "theev2_db"; mysql_connect(localhost,$name,$pass) or die("cant connect"); @mysql_select_db($db) or die( "Unable to select database"); $query = "INSERT INTO contacts VALUES ('',$_POST["url"], $_POST["recomendtoothers"], $_POST["numoffs"], $_POST["signupprocess"]',' $_POST["emailaddressesallowed"], $_POST["beenwithhishost"], $_POST["billingproblems"], $_POST["Pricevalue"], $_POST["Uptime"], $_POST["platform"], $_POST["Transfer"], $_POST["plus"], $_POST["extrafeatures"], $_POST["ExtraFeaturesbuilt"], $_POST["Biggestcomplaint"], $_POST["additionalcomments"])"; mysql_query($query); ?> I get this Parse error: parse error, unexpected '\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/theev2/public_html/tests/welcome.php on line 33 the bolded line in 33

Share this post


Link to post
Share on other sites
Firstly, you're putting double quotes inside double quotes without escaping them, and/or just using the syntax incorrectly.

Secondly, you're putting stuff into the database in a fashion likely to cause data corruption and/or sql injection exploits.

Mark

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this