这可能会帮助你,简单的方法
PHP作品只在页面加载而已,所以你需要使用的Javascript/jQuery来隐藏表,否则使用PHP mysqli_num_rows()函数,该函数返回数记录取出,如果取行,生成表,否则留下一些警告信息,我添加了样本代码
Titletable {
width: 100%;
border-collapse: collapse;
}
table,
td,
th {
border: 1px solid black;
padding: 5px;
}
th {
text-align: left;
}
Scegliete una lettera:
A
B
C
D
Vedi qui i tipi ti marche:
$result=mysqli_query($con,$sql);
if(mysqli_num_rows($result)>0) // if record found, this generate the table
{
echo "
Marca | Descrizione |
---|
while($row=mysqli_fetch_array($result)) { echo "
"; echo"
" . $row[ "marca"] . ""; echo "" . $row[ "descrizione"] . ""; echo ""; } echo "";}
else
echo "No Output for the Query";
?>