I suggest using the row count of your query to determine if a record exists:
<?php
$resultB = mysql_query("SELECT * FROM dbel6_content WHERE catid='12'") or die(mysql_error());
while($rowB = mysql_fetch_array( $resultB )) {
$articleid = $rowB['id'];
$articlename = $rowB['title'];
$resultA = mysql_query("SELECT * FROM workshoptabs WHERE articleid='$articleid'") or die(mysql_error());
if (mysql_num_rows($resultA)>0) {
// exists
echo $articleid.' Exists';
} else {
// doesnt exist
mysql_query("INSERT INTO workshoptabs (articleid, articlename) VALUES ('$articleid', '$articlename')") or die(mysql_error());
echo 'Added Articles : '.$articleid.'-';
}
}
?>
Consider looking into PDO or MySQLi, as mentioned by Joseph.