I have 24 names in a small table. I want to list these 24 with a link so that I can edit them.
I can list all of the driver numbers so I am prety sure that the MySQL query is working.
I can't list more than 12 entries.
<code>
// build query
$query = "SELECT * FROM `drivers` ORDER BY driver LIMIT 0,200";
$res = mysql_query($query, $cMysql);
if (mysql_errno() == TRUE)
{
die("Query failed");
return;
}
$cOutput = '<table width="92%" border="1" cellspacing="4" cellpadding="4">';
$cOutput.= '<tr>';
$cOutput.= '<td>Driver</td>';
$cOutput.= '<td>Van</td>';
$cOutput.= '<td>Active</td>';
$cOutput.= '</tr>';
$cOutput.= '<tr>';
$cOutput.= '<td> </td>';
$cOutput.= '<td> </td>';
$cOutput.= '<td> </td>';
$cOutput.= '</tr>';
$cOutput.= '<tr>';
$cOutput.= '<td><a href="adddriver.php%20?driver=0">Add Driver</a></td>';
$cOutput.= '<td> </td>';
$cOutput.= '<td> </td>';
$cOutput.= '</tr>';
while ($row = mysql_fetch_array($res, MYSQL_ASSOC))
{
$cOutput.= '<tr>';
//Driver name
$cOutput.= '<tr><td><a href="adddriver.php%20?driver=';
$cOutput.= $row['driver'];
$cOutput.= '>';
$cOutput.= $row['name'];
$cOutput.= '</a> </td>';
// van
$cOutput.= '<td>';
$cOutput.= $row['vantype'];
$cOutput.= '</td>';
// active
$cOutput.= '<td>';
if ($row['active'] == 0)
{
$cOutput.= 'No';
}
else
{
$cOutput.= 'Yes';
}
$cOutput.= '</td>';
echo $cOutput;
$cOutput = '';
}
Print '</tr></table></body></html>';
?>
</code>
I can list all of the driver numbers so I am prety sure that the MySQL query is working.
I can't list more than 12 entries.
<code>
// build query
$query = "SELECT * FROM `drivers` ORDER BY driver LIMIT 0,200";
$res = mysql_query($query, $cMysql);
if (mysql_errno() == TRUE)
{
die("Query failed");
return;
}
$cOutput = '<table width="92%" border="1" cellspacing="4" cellpadding="4">';
$cOutput.= '<tr>';
$cOutput.= '<td>Driver</td>';
$cOutput.= '<td>Van</td>';
$cOutput.= '<td>Active</td>';
$cOutput.= '</tr>';
$cOutput.= '<tr>';
$cOutput.= '<td> </td>';
$cOutput.= '<td> </td>';
$cOutput.= '<td> </td>';
$cOutput.= '</tr>';
$cOutput.= '<tr>';
$cOutput.= '<td><a href="adddriver.php%20?driver=0">Add Driver</a></td>';
$cOutput.= '<td> </td>';
$cOutput.= '<td> </td>';
$cOutput.= '</tr>';
while ($row = mysql_fetch_array($res, MYSQL_ASSOC))
{
$cOutput.= '<tr>';
//Driver name
$cOutput.= '<tr><td><a href="adddriver.php%20?driver=';
$cOutput.= $row['driver'];
$cOutput.= '>';
$cOutput.= $row['name'];
$cOutput.= '</a> </td>';
// van
$cOutput.= '<td>';
$cOutput.= $row['vantype'];
$cOutput.= '</td>';
// active
$cOutput.= '<td>';
if ($row['active'] == 0)
{
$cOutput.= 'No';
}
else
{
$cOutput.= 'Yes';
}
$cOutput.= '</td>';
echo $cOutput;
$cOutput = '';
}
Print '</tr></table></body></html>';
?>
</code>