Question on PHP connect MS SQL 2005

Question on PHP connect MS SQL 2005

am 11.06.2008 15:34:10 von ajwei

Hi,

I have just installed the Apache on a Linux machine, and tried to run the=
script that contains a

// connection to the database
$dbhandle=3D mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");

When I try to run the PHP script, it gives me this, which the portion it re=
fers to is the code above:
PHP Fatal error: Call to undefined function mssql_connect() in /home/TDC/D=
esktop/create_new_entry_master.php on line 20

I have took a look at the web page at http://us.php.net/function.mssql-conn=
ect, but I don't see my apache having any of the things mentioned, and I ha=
ve installed the latest version.

Have I done something wrong here?
Any suggestion is appreciated.

Alice
==================== =====3D=
==================== =====3D=
====
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@indiana.edu

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

Re: Question on PHP connect MS SQL 2005

am 11.06.2008 15:43:37 von Dan Shirah

------=_Part_7241_32116601.1213191818027
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Alice,

In regards to:

"Call to undefined function mssql_connect() in
/home/TDC/Desktop/create_new_entry_master.php on line 20"

Do you have the MSSQL extension uncommented in your PHP.ini?

Dan

------=_Part_7241_32116601.1213191818027--

RE: Question on PHP connect MS SQL 2005

am 11.06.2008 15:52:08 von ajwei

Hi,

This may sound really stupid, but I installed Fedora and checked on the b=
ox for web development to allow PHP and other web scripts on the platform. =
Therefore, I could run PHP scripts fine, and the mentioning of this file, w=
ould you be able to offer me suggestions on where it might be?

Thanks for your help.

Alice
==================== =====3D=
==================== =====3D=
====
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@indiana.edu

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

RE: Question on PHP connect MS SQL 2005

am 11.06.2008 17:31:44 von ajwei

Hi, Dan:

Thanks for the information, and my PHP has been installed, and I have com=
mented out everything from the PHP ini regarding to "MS SQL connections."
However, I am still having issues with seeing the same error as I have in =
the previous email.

Are there other things I have to try?
Thanks for your help.

Alice
==================== =====3D=
==================== =====3D=
====
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@indiana.edu
________________________________________
From: Dan Shirah [mrsquash2@gmail.com]
Sent: Wednesday, June 11, 2008 9:43 AM
To: Wei, Alice J.
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Question on PHP connect MS SQL 2005

Alice,

In regards to:

"Call to undefined function mssql_connect() in /home/TDC/Desktop/create_new=
_entry_master.php on line 20"

Do you have the MSSQL extension uncommented in your PHP.ini?

Dan

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

Re: Question on PHP connect MS SQL 2005

am 11.06.2008 17:34:25 von Ken Keefe

I know the package you need is called php-sybase in ubuntu. It's
probably something similar in Fedora. Know that this package will only
let you do a subset of the mssql function calls. If you are just
connecting and doing a normal query, it will suffice. If you need to
do prepared statements for stored procedures, you will likely have to
compile a php-mssql package manually. I just did this last night on my
ubuntu server to get some stored procedures working. Hope that helps.

Ken

On Wed, Jun 11, 2008 at 8:52 AM, Wei, Alice J. wrote:
> Hi,
>
> This may sound really stupid, but I installed Fedora and checked on the box for web development to allow PHP and other web scripts on the platform. Therefore, I could run PHP scripts fine, and the mentioning of this file, would you be able to offer me suggestions on where it might be?
>
> Thanks for your help.
>
> Alice
> ======================================================
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--

Naturally, the common people don't want war, but they can always be
brought to the bidding of the leaders. Tell them they are being
attacked, and denounce the pacifists for lack of patriotism and
endangering the country. It works the same in every country.

--- Herman Goering, Hitler's Reichsmarschall, At the Nuremberg Trials

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

Echoing a variable within a variable.

am 06.01.2009 20:30:07 von Stephen Sunderlin

I'm emailing an html file through phpmailer and the sql look up is getting
the html from a table and setting it into a variable. Within the html from
the table are also variables that are also being called by the same sql that
is looking up the html variable. However the variable in the html are
echoing as $var instead of the assigned value being called from the sql
look-up

Not sure what the solution is. Any thoughts.



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

Re: Echoing a variable within a variable.

am 07.01.2009 02:23:11 von Phpster

A couple of options:

1. Use eval($databaseString); there are risks as it could be used to
execute arbitrary code should the database be compromised.

2. If your data string is enclosed in single quote php won't evaluate
the variables. Consider changing the outside quotes to double quotes.

Bastien

Sent from my iPod

On Jan 6, 2009, at 2:30 PM, "Stephen Sunderlin" > wrote:

> I'm emailing an html file through phpmailer and the sql look up is
> getting
> the html from a table and setting it into a variable. Within the
> html from
> the table are also variables that are also being called by the same
> sql that
> is looking up the html variable. However the variable in the html are
> echoing as $var instead of the assigned value being called from the
> sql
> look-up
>
> Not sure what the solution is. Any thoughts.
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

Re: Echoing a variable within a variable.

am 07.01.2009 03:07:03 von Micah Gersten

If you use preg_replace with the e modifier, you can run eval on the
variables only:
http://us.php.net/preg_replace

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Phpster wrote:
> A couple of options:
>
> 1. Use eval($databaseString); there are risks as it could be used to
> execute arbitrary code should the database be compromised.
>
> 2. If your data string is enclosed in single quote php won't evaluate
> the variables. Consider changing the outside quotes to double quotes.
>
> Bastien
>
> Sent from my iPod
>
> On Jan 6, 2009, at 2:30 PM, "Stephen Sunderlin"
> wrote:
>
>> I'm emailing an html file through phpmailer and the sql look up is
>> getting
>> the html from a table and setting it into a variable. Within the
>> html from
>> the table are also variables that are also being called by the same
>> sql that
>> is looking up the html variable. However the variable in the html are
>> echoing as $var instead of the assigned value being called from the sql
>> look-up
>>
>> Not sure what the solution is. Any thoughts.
>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>

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