如何一次选择两个不同的表?
第一个表(表名“table1”)
capacity comment
1.0 low
1.7 low
7.2 average
9.9 fine
10.0 great
第二个表(表名“table2”)
c1 c2 c3 c4
1.0 CC AS DD
1.7 AD AC PD
10.0 AW AS AD
如果输入是 1.0 它应该显示
capacity comment c2 c3 c4
1.0 LOW CC AS PD
更新
select a.capacity,a.comment, b.c1,b.c2,b.c3 from table1 a inner join table2 b on a.capacity=b.capacity WHERE a.capacity= $name
$rs = mysql_query( $sql ) or die('Database Error: ' . mysql_error());
$num = mysql_num_rows( $rs );
if($num >= 1 ){
echo "";
while($row = mysql_fetch_array( $rs )){
echo "<table>
<tr>
<th align='left' valign='middle'>Capacity</th>
<td align='left' valign='middle'>$row[capacity]</td>
</tr>
<tr>
<th align='left' valign='middle'>C2</th>
<td align='left' valign='middle'>$row[c2]</td>
</tr>
</table>";
}
我有像(在前端)这样的预期结果
| CAPACITY | 1.0|
| C2 | CC |
但它显示有疑问
我有像(在前端)这样的预期结果
| CAPACITY | 1.0|
| C2 | CC |
| CAPACITY | 1.0|
| C2 | CC |