Jump to content

Possible SELECT error?


contraboybish

Recommended Posts

I'm getting the following error.....

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''.

 

 

<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>   

 

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 :-(

Link to comment
https://forums.phpfreaks.com/topic/186932-possible-select-error/
Share on other sites

oops, ok l added FROM but l now get the following error......  :-(

 

Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression., SQL state 22005 in SQLExecDirect in C:\xampp\htdocs\lbm\search\news.php on line 36

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.