I've the following code, and I can get the field names, but I can't get the result data, what can I do
<HEAD>
<BODY>
<?php
$user="admin";
$host="jask.dns2go.com";
$password="";
$ro = "WV";
$query = "select * from embarque";
$conn=odbc_connect($host,$user,$password);
$result=odbc_do($conn, $query);
?>
<?php
if ($result == 0):
echo ("No se Pudo Conectar");
elseif (odbc_num_rows($result) == 0):
echo("<B>Query executed successfully!</B>");
else:
?>
<TABLE BORDER=1>
<THEAD>
<TR>
<?php
for ($i = 1; $i < odbc_num_fields($result); $i++) {
echo("<TH>" . odbc_field_name($result,$i) . "</TH>");
}
?>
</TR>
</THEAD>
<TBODY>
<?php
for ($i = 1; $i < odbc_num_rows($result); $i++) {
echo("<TR>");
$row_array = odbc_fetch_row($result, $i);
for ($j = 1; $j < odbc_num_fields($result); $j++) {
echo("<TD>" . $row_array[$j] . "</TD>");
}
echo("</TR>");
}
?>
</TBODY>
</TABLE>
<?php
endif
?>
<HR><BR>
</FORM>
</BODY>
thanks
<HEAD>
<BODY>
<?php
$user="admin";
$host="jask.dns2go.com";
$password="";
$ro = "WV";
$query = "select * from embarque";
$conn=odbc_connect($host,$user,$password);
$result=odbc_do($conn, $query);
?>
<?php
if ($result == 0):
echo ("No se Pudo Conectar");
elseif (odbc_num_rows($result) == 0):
echo("<B>Query executed successfully!</B>");
else:
?>
<TABLE BORDER=1>
<THEAD>
<TR>
<?php
for ($i = 1; $i < odbc_num_fields($result); $i++) {
echo("<TH>" . odbc_field_name($result,$i) . "</TH>");
}
?>
</TR>
</THEAD>
<TBODY>
<?php
for ($i = 1; $i < odbc_num_rows($result); $i++) {
echo("<TR>");
$row_array = odbc_fetch_row($result, $i);
for ($j = 1; $j < odbc_num_fields($result); $j++) {
echo("<TD>" . $row_array[$j] . "</TD>");
}
echo("</TR>");
}
?>
</TBODY>
</TABLE>
<?php
endif
?>
<HR><BR>
</FORM>
</BODY>
thanks