I got fixed, took @ advice and got my functions sorted out. I works great now.
here is the final code so if anyone out there who was like me and spent hours searching, here it is. all you need to do is change the columns #.
<?php
require_once 'login.php';
$db_server = mysql_connect($db_hostname, $db_username, $db_password);
if (!$db_server) die("Unable to connect to server: " . mysql_error());
mysql_select_db($db_database, $db_server)
or die("Unable to select database: " .mysql_error());
$date = date("Y-m-d");
$port = "101";
echo '<p>Search for domains containing <span style="color:#ff0000;font-weight:bold;text-decoration:underline;">"' . $_GET['searchname'] . '"</span>.</p>';
$query="SELECT * FROM pickups where date = '$date'";
$result=mysql_query($query) or die (mysql_error());
// Use result
// Set column count
$columns = 4;
$rowCount = mysql_num_rows($result);
echo '<p>There are currently <span style="color:#ff0000;font-weight:bold;text-decoration:underline;">' . $rowCount . '</span> pickup requests for your system.</p>';
// Calculate how many records per column
$html = '<table width="100%" border="1" class="text"><tr>';
$x = 1;
while ($row = mysql_fetch_assoc($result)) {
$html .= '<td>' . $row['type'] . ': <a href="https://xxx.xxxxx.xxx/,DanaInfo=techportal.oss.prd+WorkdayDetails.aspx?JobType=' . $row['type'] . '">' . $row['number'] . '</a>
<br>Address: ' . $row['address'] . '</td>';
$html .= ($x++ % $columns == 0) ? '</tr><tr>' : '';
}
$html .= '</tr></table>';
echo $html;
mysql_free_result($result);
?>