我的网站有大问题,我有这个功能可以从数据库中获取所有类别:-
public function selectallcatdata()
{
$query = mysql_query("select Category_name,Category_id from category where Category_delete='0'");
return $query;
mysql_free_result($query);
}
我在这样的选择类型上使用此功能:-
<select name="txtCompanyCat" id="txtCompanyCat">
<option selected value="">choose the Category ... </option>
<?php
$CategoryNameData = $select -> selectallcatdata();
while($CatNameRow = mysql_fetch_array($CategoryNameData)){
$CatID = $CatNameRow['Category_id'];
$CatName = $CatNameRow['Category_name'];
?>
<option value="<?php echo $CatID; ?>"><?php echo $CatName; ?></option>
<?php }
unset($CatID);
unset($CatName);
?>
</select>
所以,问题是我在这个表上有 251932 行,我们必须从我的表中显示所有这些行,我该如何解决这个负载。