usman at mail.arts.ubc.ca
Wed Jul 26 19:42:17 EDT 2006
Here the test code.
// connect to a DSN "MSSQLTest"
print_r("we are trying to connect");
$connect = odbc_connect("MSSQLTest", "test_user", "passX") or die ("couldn't
// ***query the users table for all fields***
$query = "SELECT * FROM localTable";
// ***perform the query****
$result = odbc_exec($connect, $query);
// ***successfully ran query***
// ***fetch the data from the database***
$temp = mssql_num_rows($result) ;
print_r("display the number of records". $temp );
$field1 = odbc_result($result, 1);
$field2 = odbc_result($result, 2);
# close the connection
> -----Original Message-----
> From: freetds-bounces at lists.ibiblio.org [mailto:freetds-
> bounces at lists.ibiblio.org] On Behalf Of Rich Young
> Sent: Wednesday, July 26, 2006 1:04 PM
> To: FreeTDS Development Group
> Subject: Re: [freetds] no-PHP
> Do you want to show us some code? And have you looked in your error
> logs? PHP has a setting that supresses user-visible error messages for
> security reasons; if your server is configured in that manner, you might
> be missing some pretty informative info in the logs.
> I'm Rich Young, and I approved this message.
> > -----Original Message-----
> > From: freetds-bounces at lists.ibiblio.org
> > [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Usman
> > Sent: Wednesday, July 26, 2006 12:27 PM
> > To: 'FreeTDS Development Group'
> > Subject: [freetds] no-PHP
> > So, here is the situation.
> > I installed all the required libraries. Now I can connect to
> > MSSQL server from shell and run all my queries.
> > But...When I try to use it through PHP, there is no luck. I
> > don't even get an error. It apparently connects to the db
> > server ass well but doesn't loop through the result set.
> > Any ideas?
> > Thanks,
> > Usman
> > _______________________________________________
> > FreeTDS mailing list
> > FreeTDS at lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/freetds
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
More information about the FreeTDS