mssql equivalents to mysql_errno & mysql_error

mssql equivalents to mysql_errno & mysql_error

am 13.09.2005 16:42:27 von Alf C Stockton

I have looked in the online manual but am not able to find the
equivalent functions in mssql of mysql_errno() & mysql_error().
I am in the unfortunate position of having to develop using an existing
MSSQL database.

--

Regards,
Alf Stockton www.stockton.co.za

Lady Luck brings added income today. Lady friend takes it away tonight.

My email disclaimer is available at www.stockton.co.za/disclaimer.html

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mssql equivalents to mysql_errno & mysql_error

am 13.09.2005 16:57:19 von Mark Rees

I have looked in the online manual but am not able to find the
> equivalent functions in mssql of mysql_errno() & mysql_error().
> I am in the unfortunate position of having to develop using an existing
> MSSQL database.

There aren't any as far as I know. I think the best you can do is test for
the existence of whatever you are looking for (connection, result set etc)
at each stage and do something graceful. Not much use for debugging though.

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: mssql equivalents to mysql_errno & mysql_error

am 13.09.2005 17:17:47 von Mark Rees

------=_NextPart_000_0044_01C5B87E.ADE0AD20
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thanks for your advice.=20
ADODB link
http://adodb.sourceforge.net/

Please use reply all to send your message to the list

-----------------------------------------
in my experience is better to use an abstraction layer library like =
adodb=20
this will allow you to switch database in the future, besides that =
provides error control and debug options and it is extremly easy to =
develop with.

Luck!


I have looked in the online manual but am not able to find the
equivalent functions in mssql of mysql_errno() & mysql_error().
I am in the unfortunate position of having to develop using an existing
MSSQL database.
=20
There aren't any as far as I know. I think the best you can do is test =
for
the existence of whatever you are looking for (connection, result set =
etc)
at each stage and do something graceful. Not much use for debugging =
though.


------=_NextPart_000_0044_01C5B87E.ADE0AD20--

I Can"t connect to MySql using ADODB

am 15.09.2005 07:33:50 von Tony Aldemir

Hi There,

I am trying to connect to MySQL using ADODB library for PHP using the
following code with no success. What am I doing wrong?

include('/php/adodb.inc.php');

$db =3D &ADONewConnection('mysql'); # eg. 'mysql' or 'oci8'=20
$db->debug =3D true;
$db->Connect('localhost', 'tony', 'mypassword', 'test');
$rs =3D $db->Execute('select * from users');
print "

";
print_r($rs->GetRows());
print "
";
?>

Notes:
1) After unzipping the downloaded ADODB file into a directory, I copied =
the
adodb.inc.php file by itself into my c:\PHP directory. The ADODB
documentation says "Unpack all the files into a directory accessible by =
your
webserver". What does this mean? Is there a setting somewhere in the
Apache Server that I need to tweak (e.g. some sort of setting in the
httpd.conf)?=20
=20
2) By the way, I CAN connect to MySQL using PHP directly (i.e. without =
the
use of ADODB) just fine and work with the 'test' database's 'users' =
table. =20

Any help will be greatly appreciated.

Regards,
Tony


-----Original Message-----
From: Mark Rees [mailto:mrees@itsagoodprice.com]=20
Sent: Tuesday, September 13, 2005 7:18 AM
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] Re: mssql equivalents to mysql_errno & =
mysql_error

Thanks for your advice.=20
ADODB link
http://adodb.sourceforge.net/

Please use reply all to send your message to the list

-----------------------------------------
in my experience is better to use an abstraction layer library like =
adodb=20
this will allow you to switch database in the future, besides that =
provides
error control and debug options and it is extremly easy to develop with.

Luck!


I have looked in the online manual but am not able to find the
equivalent functions in mssql of mysql_errno() & mysql_error().
I am in the unfortunate position of having to develop using an existing
MSSQL database.
=20
There aren't any as far as I know. I think the best you can do is test =
for
the existence of whatever you are looking for (connection, result set =
etc)
at each stage and do something graceful. Not much use for debugging =
though.

=20

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: I Can"t connect to MySql using ADODB

am 15.09.2005 13:28:44 von Alf C Stockton

Tony Aldemir wrote:

>Hi There,
>
>I am trying to connect to MySQL using ADODB library for PHP using the
>following code with no success. What am I doing wrong?
>
> >include('/php/adodb.inc.php');
>
>$db = &ADONewConnection('mysql'); # eg. 'mysql' or 'oci8'
>$db->debug = true;
>$db->Connect('localhost', 'tony', 'mypassword', 'test');
>$rs = $db->Execute('select * from users');
>print "

";
>print_r($rs->GetRows());
>print "
";
>?>
>
>Notes:
>1) After unzipping the downloaded ADODB file into a directory, I copied the
>adodb.inc.php file by itself into my c:\PHP directory. The ADODB
>documentation says "Unpack all the files into a directory accessible by your
>webserver". What does this mean? Is there a setting somewhere in the
>Apache Server that I need to tweak (e.g. some sort of setting in the
>httpd.conf)?
>
>2) By the way, I CAN connect to MySQL using PHP directly (i.e. without the
>use of ADODB) just fine and work with the 'test' database's 'users' table.
>
>
>
"Unpack all the files into a directory accessible by your webserver" means placing those files either in the htdocs folder or a folder below that one. ie Unless you have fiddled with Apache settings in httpd.conf Apache controls what folders browsers can see on your server and the default is as I have stated above.
An example would be my setup which is http://localhost/Kiosk/debug.html and it finds my adodb files in c:\Pogram Files\Apache Group\Apache2\htdocs\Kiosk\adodb. From that you can see, if I have explained clearly enough, that a browser looking at http://localhost/Kiosk/debug.html cannot "see" anything below c:\Program Files\Apache Group\Apache2\htdocs\Kiosk and for that matter I could place the debug.html in htdocs rather than Kiosk and the browser command would be http://localhost/debug.html in other words Apache defaults to htdocs as the root.

--

Regards,
Alf Stockton www.stockton.co.za

You will be the last person to buy a Chrysler.

My email disclaimer is available at www.stockton.co.za/disclaimer.html

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: I Can"t connect to MySql using ADODB

am 15.09.2005 13:36:25 von Mark Rees

> Tony Aldemir wrote:
>
> >Hi There,
> >
> >I am trying to connect to MySQL using ADODB library for PHP using the
> >following code with no success. What am I doing wrong?
> >
> > > >include('/php/adodb.inc.php');
> >
> >$db = &ADONewConnection('mysql'); # eg. 'mysql' or 'oci8'
> >$db->debug = true;
> >$db->Connect('localhost', 'tony', 'mypassword', 'test');
> >$rs = $db->Execute('select * from users');
> >print "

";
> >print_r($rs->GetRows());
> >print "
";
> >?>
> >
> >Notes:
> >1) After unzipping the downloaded ADODB file into a directory, I copied
the
> >adodb.inc.php file by itself into my c:\PHP directory. The ADODB
> >documentation says "Unpack all the files into a directory accessible by
your
> >webserver". What does this mean? Is there a setting somewhere in the
> >Apache Server that I need to tweak (e.g. some sort of setting in the
> >httpd.conf)?
> >
> >2) By the way, I CAN connect to MySQL using PHP directly (i.e. without
the
> >use of ADODB) just fine and work with the 'test' database's 'users'
table.
> >
> >
> >
> "Unpack all the files into a directory accessible by your webserver" means
placing those files either in the htdocs folder or a folder below that one.
ie Unless you have fiddled with Apache settings in httpd.conf Apache
controls what folders browsers can see on your server and the default is as
I have stated above.
> An example would be my setup which is http://localhost/Kiosk/debug.html
and it finds my adodb files in c:\Pogram Files\Apache
Group\Apache2\htdocs\Kiosk\adodb. From that you can see, if I have explained
clearly enough, that a browser looking at http://localhost/Kiosk/debug.html
cannot "see" anything below c:\Program Files\Apache
Group\Apache2\htdocs\Kiosk and for that matter I could place the debug.html
in htdocs rather than Kiosk and the browser command would be
http://localhost/debug.html in other words Apache defaults to htdocs as the
root.
>


Further to this, you can set the include_path in php.ini. It is generally
recommended to put these files outside the webroot (htdocs as described
above).

More information

http://uk2.php.net/manual/en/ini.core.php#ini.include-path

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php