When you're echoing with double quotes, any other double quote inside that string must be escaped (prepend a character with a backslash) - meaning "take this literally, don't interpret it".
echo "<table class=\"listing\" cellpadding=\"0\" cellspacing=\"0\">";
When using single quotes, you can have un-escaped double quotes.
echo '<table class="listing" cellpadding="0" cellspacing="0">';
Also, there are several ways to concatenate or insert a variable intro a string:
echo '<td>' . $vendorname . '</td>';
echo "<td>" . $vendorname . "</td>";
echo "<td>$vendorname</td>"; // PHP interprets variables inside double quotes
echo "<td>" , $vendorname , "</td>"; // you can use commas also
echo "<td>{$vendorname}</td>";
// using HEREDOC syntax
echo $string =<<<WHATEVER
<td>$vendorname</td>
<td>$contactperson</td>
<td>$type</td>
<td>$contactaddress</td>
WHATEVER;
I'm just taking my time to explain this because I was in your small shoes not long ago, otherwise I would say something like "hey, pal, do learn the basics, will ya?". Google "concatenation php".
LE: Didn't saw the above posts. I'm just repeating what neilmasters said.