Click to See Complete Forum and Search --> : PHP & ODBC & MSaccess & Apache problem


Anon
01-29-2001, 10:00 AM
Hy,

I have, I think, a strange problem with executing php script in different Web server using the odbc php related functions. I writed a litle script like this :

<head>
<title>Exemple</title>
</head>
<body>
<?php

$dsn = "database";
$user = "toto";
$password = "";
$cursor_type = "SQL_CUR_USE_ODBC";
$query_string = "SELECT Document.TitreDoc
FROM Document";

$odbcid = odbc_connect ($dsn, $user, $password, "");
$resultid = odbc_exec ($odbcid, $query_string) ;
$result = odbc_result_all ($resultid,"");
echo $result;
?>
</body>


When I execute this script in Windows2000 terminal with the syntax "php test.php", it work well. But when I execute the script into a web page by clicking on the link "<A HREF = /cgi-bin/test.php>test</A>" the script doesn't work. I try this script into Apache, Xitami and IIS, but neither of them wants to work. I installed the php latest released and cgi interface for all this servers, I have configured all the server to work with php which is ok (I have test by executing a little script like echo "hello";), but it doesn't want to work. I have the same message : "Warning: SQL error: [Microsoft][Gestionnaire de pilotes ODBC] Source de données non trouvée et nom de pilote non spécifié, SQL state IM002 in SQLConnect in D:\Intranet\wwwroot\cgi-bin\bd.php on line 22". I have verified the name of the odbc ressource in my query odbc_connect and at this point I don't know why it doesn't want to work..I think it's a little thing and if someone has either encounter the problem, it can help me..

Thank you ..

Gael.......

mfjma
01-29-2001, 11:14 AM
Try this:
http://www.phpbuilder.com/columns/siddarth20000228.php3
I tried it on W2K Professional and it works.

sj314
03-02-2002, 08:42 AM
Hi!
I had the same problem PHP+APACHE+MSSQL.
But when I start APACHE as USER, not as LOCALHOST everything become ok.