html data from my access db appears in my php page
Posted: Wed Nov 26, 2003 6:45 pm
html data from my access db appears in my php page when i use $source*
i´m writing a PHP page to query an Access database via ODBC and something very weird happened: the whole content of the database table I was trying to query appears in a html table on my webpage. Do you know how I can avoid that? It is very annoying as I can´t keep on writing the page.
my php code is:
<?php
$conn=odbc_connect('bd','user','password');
if (!$conn) {
exit("Connection Failed: " . $conn);
}
$sql = "SELECT * FROM t_termino WHERE Champ = '865' ORDER BY CleFr";
$rs = odbc_exec($conn, $sql);
if (!$rs) {
exit("Error in SQL");
}
while (odbc_fetch_row($rs)) {
$field($rs,"field");
if (isset ($field)) {
echo $field;}
}?>
for instance:
$NoteTechniqueFr($rs,"NoteTechniqueFr");
if (isset ($NoteTechniqueFr)) {
echo $NoteTechniqueFr;
}
i´ve found out that the table only appears when 'field' is 'SourceNTFr' or 'SourceNLFr' or 'SourceNTEn' or 'SourceNLEn' (even 'src*' if i replace source with src)... but strangely not 'SourceCleFr' !!
the fact that the following script appeared from nowhere in the page (after </head> and </html>) might be somehow related:
<!-- ZoneLabs Privacy Insertion -->
<script language='javascript' src='http://127.0.0.1:3004/js.cgi?aw&r=4596'></script>
the script doesn´t seem to be directly related to the fact that the table containing all data from the db appears on my webpage. the script seems to be there all the time, but the table only appears in the abovementioned case.
Thank you very much. If you can come up with something I can try, I would be much grateful. All my work is stopped because of that.
i´m writing a PHP page to query an Access database via ODBC and something very weird happened: the whole content of the database table I was trying to query appears in a html table on my webpage. Do you know how I can avoid that? It is very annoying as I can´t keep on writing the page.
my php code is:
<?php
$conn=odbc_connect('bd','user','password');
if (!$conn) {
exit("Connection Failed: " . $conn);
}
$sql = "SELECT * FROM t_termino WHERE Champ = '865' ORDER BY CleFr";
$rs = odbc_exec($conn, $sql);
if (!$rs) {
exit("Error in SQL");
}
while (odbc_fetch_row($rs)) {
$field($rs,"field");
if (isset ($field)) {
echo $field;}
}?>
for instance:
$NoteTechniqueFr($rs,"NoteTechniqueFr");
if (isset ($NoteTechniqueFr)) {
echo $NoteTechniqueFr;
}
i´ve found out that the table only appears when 'field' is 'SourceNTFr' or 'SourceNLFr' or 'SourceNTEn' or 'SourceNLEn' (even 'src*' if i replace source with src)... but strangely not 'SourceCleFr' !!
the fact that the following script appeared from nowhere in the page (after </head> and </html>) might be somehow related:
<!-- ZoneLabs Privacy Insertion -->
<script language='javascript' src='http://127.0.0.1:3004/js.cgi?aw&r=4596'></script>
the script doesn´t seem to be directly related to the fact that the table containing all data from the db appears on my webpage. the script seems to be there all the time, but the table only appears in the abovementioned case.
Thank you very much. If you can come up with something I can try, I would be much grateful. All my work is stopped because of that.