RE: [PHP-WIN] ODBC Error....
| From: | Asendorf, John | Date: | Wed, 06 Sep 2000 14:28:56 +0000 |
| Subject: | RE: [PHP-WIN] ODBC Error.... | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-2468@lists.php.net to get a copy of this message | ||
try some simpler SQL to test the connection:
$sql = "SELECT *
FROM Mp3List";
---------------------
John Asendorf - jasendorf@lcounty.com
Web Applications Developer
http://www.lcounty.com - CHECK OUT THE NEW LOOK!
Licking County, Ohio, USA
740-349-3631
> -----Original Message-----
> From: John Whitaker [mailto:jwhitake@agad.purdue.edu]
> Sent: Wednesday, September 06, 2000 10:33 AM
> To: php-windows@lists.php.net; Pablo Vera
> Subject: Re: [PHP-WIN] ODBC Error....
>
>
> Here is the code giving me the problems...
>
> <?php
>
> print "Content-type: text/html \n\n";
> print "<HTML><HEAD><TITLE>Search
> Results...</TITLE></HEAD>\n";
> print "<BODY BGCOLOR='black'><FONT
> FACE='arial,helvetica'><FONT
> COLOR='#FFFF00'>\n";
>
> print "<H2>Search results for $sFind</H2>\n";
>
>
> $dsn = "mp3s";
>
> /* connect to db*/
> $conn = odbc_connect($dsn,"","");
> if ($conn <= 0) {
> echo "Error connecting to database<BR>";
> exit;
> }
> else {
> echo "<P>connected to mp3 database...\n<BR>";
> };
>
>
> /* make SQL statement */
> $sql = "SELECT Artist, Album, Song FROM Mp3List WHERE Song LIKE
> \"*$songTitle*\" ORDER BY Song";
> echo $sql;
> echo "<BR>";
>
> /* prepare SQL statement */
> $sql_result = odbc_prepare($conn, $sql);
>
> /* execute SQL statement and get results */
> odbc_execute($sql_result);
>
> /* print results in table */
> odbc_result_all($sql_result,"border=1");
>
>
>
> Pablo Vera wrote:
>
> > John:
> >
> > Can you send a sample of your script, or of the SQL query you are
> > using. It seems to me that you have a syntax error (a
> misspelled table
> > or field name), because Access is asking for 2 parameters,
> this means,
> > that there are to items not recognized in your query.
> >
> > Saludos,
> > Pablo Vera
> > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> >
> > Wednesday, September 06, 2000, 9:22:48 AM, John wrote:
> >
> > JW> I am getting the following error when trying to connect
> to a MS Access
> > JW> db using ODBC.
> >
> > JW> Warning: SQL error: [Microsoft][ODBC Microsoft Access
> Driver] Too few
> > JW> parameters. Expected 2., SQL state 07001 in SQLExecute in
> > JW> C:\WEBSHARE\SCRIPTS\findSong.php on line 32
> >
> > JW> Any thoughts?
> > JW> Thanks.
> > JW> --
> > JW> John Whitaker
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-windows-help@lists.php.net
> > To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
> --
> John Whitaker
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>