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. ?> Link to comment https://forums.phpfreaks.com/topic/121994-whats-wrong-with-this-mysql/ 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 Link to comment https://forums.phpfreaks.com/topic/121994-whats-wrong-with-this-mysql/#findComment-629684 Share on other sites More sharing options...
fenway Posted August 30, 2008 Share Posted August 30, 2008 .... like not inserting any data, for example. Link to comment https://forums.phpfreaks.com/topic/121994-whats-wrong-with-this-mysql/#findComment-629811 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.