Böyle bir tablo oluşturur bazı kod var:
for($i=0; $i<$fields_num; $i++)
{
$field = mysql_fetch_field($result);
echo "<td" . $i;
echo "></td>";
}
echo "</tr>\n";
// printing table rows
while($row = mysql_fetch_row($result))
{
echo "<tr>";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
$counter = 0;
foreach($row as $cell)
{
if($counter == 0)
{//1st column
echo "<td><strong>" .$cell. "</strong></td>";
}
elseif($counter == 8)
{//7th column
echo "<td><img src=\"http://php.alton.com/image.php/image.jpg?width=100&height=100&cropratio=1:1&image=".$cell."\" /></td>";
}
elseif($counter == 9)
{//eighth column
echo "<td><strong>" .$cell. "</strong></td>";
}
else
echo "<td>$cell</td>";
//inside your default td
$counter++;
}
echo "</tr>\n";
}
Ben sütunda 0 (ID) dan MySQL sonuç almak ve sonucu bir URL parametresine bu değişkeni geçmek için çalışıyorum. Ben Sütun 8 SQL sonuçları sütununun 0 dan kimliğini içeren bir bağlantı oluşturmak istiyorum Örneğin:. Kimliği satırda 1. sütun geliyor? "/ Details.php ID = 43". Bu mantıklı mı?