Vivid Lust Posted August 30, 2008 Share Posted August 30, 2008 I get the 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 '' at line 1 Code: <?php # Connect to mysql $link = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); # Store data in database $sql = "INSERT INTO ".$dbname.".".$table; if (!mysql_query($sql)){echo mysql_error();}; # Create url $sql2 = "SELECT 'id' FROM ".$dbname.".".$table." WHERE 'name'=".$name." and 'email' =".$email; ?> Thanks for any help. ?> Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 30, 2008 Share Posted August 30, 2008 Crikey! There's so much wrong that the best thing to do would be for you to read a simple tutorial before attempting anything else. A good starting page is http://www.tizag.com/mysqlTutorial/mysqlselect.php Quote Link to comment Share on other sites More sharing options...
fenway Posted August 30, 2008 Share Posted August 30, 2008 .... like not inserting any data, for example. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.