问题是,搜索后没有显示结果..搜索是使用textform完成的。表单可以基于多个textform进行搜索,我的代码有什么问题吗?仍然是php的新手
$sql = " SELECT jobseeker.*, jobseeker_pendidikan.kursus, jobseeker_pengalaman.jawatan
FROM jobseeker INNER JOIN jobseeker_pendidikan
ON jobseeker.no_kp = jobseeker_pendidikan.no_kp JOIN jobseeker_pengalaman
ON jobseeker_pendidikan.no_kp = jobseeker_pengalaman.no_kp
WHERE jobseeker.status_kerja = 'pencari kerja' ".$str.$str_mukim.$str_jantina.$str_umur.$str_jawatan.$str_tarafpend.$str_kursus."";
$sql_result = mysql_query($sql) or die (mysql_error());
if (mysql_num_rows($sql_result)>0) {
while ($row = mysql_fetch_assoc($sql_result)){
for($i = 0; $i < 0; $i++){
//$i = 0;
?>
<tr valign="top">
<td><?php echo ($i+1); ?></td>
<td><?php echo displayNama(ucwords(stripslashes($row['nama'])), $row['no_kp']); ?></td>
<td><?php echo ucwords(stripslashes($row['no_kp'])); ?></td>
<td><?php echo stripslashes($row['alamat']); ?></td>
<td><?php echo ucwords(stripslashes($row['jantina'])); ?></td>
</tr>
<?php
}
}
}
答案 0 :(得分:3)
`for($i = 0; $i < 0; i++)
确实不会运行(因为它运行的时间很长$i < 0
,这绝不是)
将while循环重写为以下内容,假设您要对行进行编号:
$i = 0;
while ($row = mysql_fetch_assoc($sql_result)) {
// No for loop
// HTML what you already had here
$i++;
}