ChrisRChamberlain
Programmer
Hi all
PHP newbie so please be gentle.![[wink] [wink] [wink]](/data/assets/smilies/wink.gif)
The following script retrieves data and displays the results from a Visual Foxpro table.
What modifications are needed to display n records per page and allow navigation to each page?
TIA
![[pc2] [pc2] [pc2]](/data/assets/smilies/pc2.gif)
PDFcommander.com
PDFcommander.co.uk
PHP newbie so please be gentle.
![[wink] [wink] [wink]](/data/assets/smilies/wink.gif)
The following script retrieves data and displays the results from a Visual Foxpro table.
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<table width="75%" border="1" cellspacing="1" cellpadding="1" bgcolor="#FFFFFF">
<tr bgcolor="#CCFFFF">
<td height="22"><b>Company</b></td>
<td height="22"><b>Street</b></td>
<td height="22"><b>Town</b></td>
</tr>
<?php
//connect to the database
$connectionstring = odbc_connect("vfptable", "", "");
//SQL query
$Query = "SELECT company, street, town FROM contacts where 'A' $ company OR 'M' $ company";
//execute query
$queryexe = odbc_do($connectionstring, $Query);
//query database
while(odbc_fetch_row($queryexe))
{
$company = odbc_result($queryexe, 1);
$street = odbc_result($queryexe, 2);
$town = odbc_result($queryexe, 3);
//format results
print ("<tr>");
print ("<td>$company</td>");
print ("<td>$street</td>");
print ("<td>$town</td>");
print ("</tr>");
}
//disconnect from database
odbc_close($connectionstring);
?>
</table>
</body>
</html>
TIA
FAQ184-2483 - answering getting answered.
Chris ![[pc2] [pc2] [pc2]](/data/assets/smilies/pc2.gif)
PDFcommander.com
PDFcommander.co.uk