私はregister_globalsを排除しなければならなかったので、私はPHP/mysqlの古い内部Webアプリケーションをデバッグしています。私はPHPプログラマーではありませんが、ほとんどのエラーが修正されているように見え、サイトは99%機能しているようです。私はこの1つに困っています。コードが機能し、問題の行がテーブルの最後を埋めると私は信じています。PHPを使ったHTMLテーブルからのヌルインデックスエラー
が$results[$label] || $results[$label] = " ";
ここより完全な外観:
$cols = 4;
$order = array();
$rows = ceil(count($labels)/$cols);
$labels = array_pad($labels, $cols*$rows, '');
$newlabels = array_chunk($labels, $rows);
for ($i = 0; $i < count($newlabels[0]); $i++) {
for ($j = 0; $j < count($newlabels); $j++) {
array_push($order, $newlabels[$j][$i]);
}
}
echo "<p>";
echo "<table width=100% border=1 noshade>";
$form = "general-add-form.php";
$anchor = " <a href=\"$form?tablename=$tablename&col1=$col1&ID=$ID\">
$results[$col1]</a>";
echo "<tr>
<th>$col1</th><td>$anchor</td>
<th>$col2</th><td>$results[$col2]</td>
</tr>";
echo "<tr>";
foreach ($order as $label) {
$results[$label] || $results[$label] = " ";
echo "<th>", ucfirst($label), "</th>";
echo "<td>$results[$label]</td>";
$z++; if (! ($z % $cols)) echo "</tr><tr>";
}
私はそれらのエラーへの参照をたくさん見つけました。私を得たものは未定義がnullであった。 - ありがとうございます –