If you are trying to make $blah contain all the echo statements ...

Set $blah to blank ...

Then on each echo that you have you would use:

PHP Code:
$blah .=  '          <tr>' "\n" .
             
'            <td class="smallText" align="center">' zen_datetime_short($orders_history->fields['date_added']) . '</td>' "\n" .
             
'            <td class="smallText" align="center">'
Notice the echo is removed and the .= is there ... this means to keep adding on to $blah

So it starts out with
$blah = '';

Then you build the content only if you enter the IF statement because the record count is > 0 ... otherwise at the end of the IF $blah will still be blank or contain nothing ...
PHP Code:
if ($orders_history->RecordCount() > 0) {