Re: ODBC Error....
| From: | Derek Paterson | Date: | Wed, 06 Sep 2000 15:26:49 +0000 |
| Subject: | Re: ODBC Error.... | ||
| References: | 1 2 3 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2477@lists.php.net to get a copy of this message | ||
It'll be this bit...
\"*$songTitle*\"
Have you snipped the bit where you set this variable, is the case right,
drop the slashes and quotes.
$sql = "SELECT Artist, Album, Song FROM Mp3List WHERE Song LIKE
$songTitle ORDER BY Song";
Derek
----- Original Message -----
From: "John Whitaker" <jwhitake@agad.purdue.edu>
To: <php-windows@lists.php.net>; "Pablo Vera" <pvz@vercan.com>
Sent: 06 September 2000 15:32
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
>
>