RE: [PHP] ODBC Query String
| From: | Andrew Hill | Date: | Tue, 29 Aug 2000 12:06:49 +0000 |
| Subject: | RE: [PHP] ODBC Query String | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14099@lists.php.net to get a copy of this message | ||
Jack,
Take a peek at this - it's a sample ODBC connection script that works fine.
Best regards,
Andrew
----------------------------------------------------
Andrew Hill
Professional Services Consultant
OpenLink Software
http://www.openlinksw.com
Universal Database Connectivity Technology Providers
$dsn="DSN=OracleLocal";
$user="UID=scott";
$password="PWD=tiger";
$sql="SELECT * FROM EMP";
if ($conn_id=odbc_connect("$dsn","$user","$password")){
echo "connected to DSN: $dsn<br><br>";
if($result=odbc_do($conn_id, $sql)) {
odbc_result_all($result);
echo "freeing result<br><br>";
odbc_free_result($result);
}else{
echo "can not execute '$sql'<BR><BR>";
}
echo "closing connection $conn_id";
odbc_close($conn_id);
}else{
echo "can not connect to DSN: $dsn<br><br>";
}
> -----Original Message-----
> From: Jack Pappas (AIM: 'Prof Quail') [mailto:Professor_Quail@yahoo.com]
> Sent: Monday, August 28, 2000 10:52 PM
> To: php-general@lists.php.net
> Subject: [PHP] ODBC Query String
>
>
> Hey folks,
> I've been using PHP on my windows box, but I've run into some problems
> accessing ODBC databases. Here's my problem:
>
> $cur= odbc_exec( $cnx, "SELECT
> RadioID,FirstName,LastName,Position,Email,LastYear,Birthdate,Birth
> place,Grade,LikeAboutRadio,WhatJobIs,HaveAShow,Music,SportsClubs,Q
> uote,OtherInfo
> FROM BioInfo ORDER BY Position" );
>
> There's something wrong with that particular part of my code, I've
> scratched my brain for days trying to figure out the problem! I'm
> getting the folllowing error message:
>
> Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few
> parameters. Expected 1., SQL state 07001 in SQLExecDirect in
> D:\biolist.php on line 71
>
> Can anyone help me with this!? Thanks in advance, -Jack
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>