Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.