Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't display all of the rows

Status
Not open for further replies.

Elmserv

Programmer
Sep 25, 2004
72
GB
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>&nbsp;</td>';
$cOutput.= '<td>&nbsp;</td>';
$cOutput.= '<td>&nbsp;</td>';
$cOutput.= '</tr>';
$cOutput.= '<tr>';
$cOutput.= '<td><a href="adddriver.php%20?driver=0">Add Driver</a></td>';
$cOutput.= '<td>&nbsp;</td>';
$cOutput.= '<td>&nbsp;</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>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top