Possible SELECT error?
Posted: Sat Jan 02, 2010 7:45 am
I'm getting the following error.....
I think there is something wrong with the select command....
query = odbc_exec($odbc, "SELECT * Search WHERE sId='$_GET[sid]'") or die (odbc_errormsg());
Any thoughts anyone
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '* Search WHERE sId='171''., SQL state 37000 in SQLExecDirect in C:\xampp\htdocs\lbm\search\news.php on line 36
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '* Search WHERE sId='171''.
Code: Select all
<div id="mainContent">
<?php require_once('../App_Data/odbc_open.php');
[b]query = odbc_exec($odbc, "SELECT * Search WHERE sId='$_GET[sid]'") or die (odbc_errormsg());[/b]
while($row = odbc_fetch_array($query))
{
echo '<tr style="text-align:justify">';
echo '<td valign="top" colspan="2">';
echo '<div style="padding-right:7px"><i><a href="'.$row['nUrl'].'" class="style2" > '.$row['sHeading'].'</a>
</i><br /></div>';
echo '</td>';
echo '</tr>';
}
odbc_close($odbc); ?>
</div> query = odbc_exec($odbc, "SELECT * Search WHERE sId='$_GET[sid]'") or die (odbc_errormsg());
Any thoughts anyone