Jump to content

Whats wrong with this MySQL??


Vivid Lust

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.