Two sql statement

A

Anonymous

Guest
i want to use this statement, but how to write in PHP? help me thanks

SELECT ColumnName FROM TableA WHERE ColumnName NOT IN(SELECT ColumnName FROM TableB);
 
Code:
$sql="SELECT ColumnName FROM TableA WHERE ColumnName NOT IN(SELECT ColumnName FROM TableB);";
      $result=mysql_query($sql) or die ("<h3>Error</h3><p><b>".mysql_error()."</b></p>");
      while($row=mysql_fetch_array($result)) {

      }
 
it doesn't work, this error show up


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 'SELECT PartID FROM frame)' at line 1
 
i use the code that u recomment, but i chage the able and field name only,
 
Back
Top