<table>
<?php
$con = mysql_connect("localhost", "root","");
mysql_select_db("mydatabase2");
mysql_query("set NAMES utf8");
$select "SELECT namepro as np,budget as bp FROM project2
UNION
SELECT SUM(money) as tomoney,namepro as dp FROM donate";
$result = mysql_query($select) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<tr>";
echo "<td>".$row["namepro"]."</td>";
echo "<td>".$row["budget"]."</td>";
echo "<td>".$tomoney."</td>";
$moredo = $row["budget"] - $tomoney <= 0 ? "0" : $moredo;
echo "<td>".$moredo."</td>";
echo "</tr>";
}
?>
</table>
ผมลอง union แล้วมันขึ้น Parse error: syntax error, unexpected '"SELECT namepro as np,budget a' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\1.php on line 8
ผมต้องแก้ตรงไหนให้ error หรอครับ ลองหาในเน็ตแล้วแต่ผมไม่เข้าใจอะครับ