PHP,MySQL UNION查询错误

I am having a problem trying to debug this query using PHP/MySQl-AJAX: The variable $param is the result of a AJAX call on a form textbox. In essence I am trying to generate a dynamic search over three database tables which unfortunately have different fields (hence the concat). The data are addresses of jobs which have a spatial location (for the first two tables) generated using different methods, the last table is non spatial data.

            $fetch = "(SELECT JobNo AS JobNo, CONCAT(Title1, '-', Title2, '-', Title3) AS Description, 'Hurricane' as type FROM Hurricanev2 WHERE Title1 REGEXP '$param' OR Title2 REGEXP '$param' OR Title3 REGEXP '$param') 
       UNION ALL
       (SELECT jobNo AS JobNo, description As Description, address As Geocoded_address, 'geocoded' as type FROM jr WHERE description REGEXP '$param' OR address REGEXP '$param')
       UNION ALL
       (SELECT job As JobNo, description As Description, 'plan' as type FROM register WHERE description REGEXP '$param')";


    while ( $row = mysql_fetch_object( $fetch ) ) {

        $sResults .= '<tr>';
        $sResults .= '<td>' . $row['JobNo'] . '</td>';
        $sResults .= '<td>' . $row['Description'] . '</td></tr>';
    }

thanks in advance

for UNION you need to have the same number of columns for each SELECT. Try adding in an extra null on first and last SELECT to even in out.

You can't union the result sets which has different number of columns.

Try the following;

$fetch = "(SELECT JobNo AS JobNo, CONCAT(Title1, '-', Title2, '-', Title3) AS Description, 'Hurricane' as type, 'extra' FROM Hurricanev2 WHERE Title1 REGEXP '$param' OR Title2 REGEXP '$param' OR Title3 REGEXP '$param') 
   UNION ALL
   (SELECT jobNo AS JobNo, description As Description, address As Geocoded_address, 'geocoded' as type FROM jr WHERE description REGEXP '$param' OR address REGEXP '$param')
   UNION ALL
   (SELECT job As JobNo, description As Description, 'plan' as type, 'extra' FROM register WHERE description REGEXP '$param')";