Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Célio de Souza

[Resolvido] Call to undefined function mssql_connect()

Recommended Posts

pessoal... estou tentando testar a conexao com o banco SQL SERVER e esta dando esse erro...

 

Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\banco\teste.php on line 8

 

 

<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
$servidor = "nome_do_banco_de_dados";
$usuario = "nome_do_usuario_criado";
$banco = "nome_do_banco_de_dados";
$senha = "senha_atribuida_para_o_bd";
$conmssql = mssql_connect($servidor.":1433",$usuario,$senha);
$db = mssql_select_db($banco, $conmssql);
if ($conmssql && $db){
echo "Parabens!! A conexão ao banco de dados ocorreu normalmente!";
} else {
echo "Nao foi possivel conectar ao banco, entre em contato com o TI Atraves do ";
}
?>

 

 

meu php.ini:

 

; Windows Extensions

; Note that ODBC support is built in, so no dll is needed for it.

; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)

; extension folders as well as the separate PECL DLL download (PHP 5).

; Be sure to appropriately set the extension_dir directive.

 

extension=php_bz2.dll

;extension=php_curl.dll

;extension=php_dba.dll

;extension=php_dblib.dll

extension=php_mbstring.dll

extension=php_exif.dll

extension=php_fileinfo.dll

extension=php_gd2.dll

extension=php_gettext.dll

;extension=php_gmp.dll

extension=php_imap.dll

;extension=php_interbase_firebird.dll

;extension=php_interbase_interbase.dll

;extension=php_intl.dll

;extension=php_ldap.dll

extension=php_mcrypt.dll

extension=php_mssql.dll

;extension=php_mysql_mysqlnd.dll

extension=php_mysql_libmysql.dll

;extension=php_mysqli_mysqlnd.dll

extension=php_mysqli_libmysql.dll

;extension=php_oci8.dll

extension=php_pdo.dll

;extension=php_pdo_dblib.dll

;extension=php_pdo_firebird_firebird.dll

;extension=php_pdo_firebird_interbase.dll

extension=php_pdo_mssql.dll

;extension=php_pdo_mysql_mysqlnd.dll

extension=php_pdo_mysql_libmysql.dll

extension=php_pdo_odbc.dll

;extension=php_pdo_pgsql.dll

extension=php_pdo_sqlite.dll

;extension=php_pdo_sqlite_external.dll

;extension=php_pgsql.dll

;extension=php_pspell.dll

;extension=php_shmop.dll

;extension=php_snmp.dll

extension=php_soap.dll

extension=php_sockets.dll

extension=php_sqlite.dll

extension=php_sqlite3.dll

;extension=php_sybase_ct.dll

;extension=php_tidy.dll

extension=php_xmlrpc.dll

extension=php_zip.dll

 

[PECL]

;extension=php_apc.dll

;extension=php_dbase.dll

;extension=php_fbsql.dll

extension=php_ming.dll

;extension=php_msql.dll

extension=php_pdflib.dll

;extension=php_pdo_oci.dll

;extension=php_rar.dll

 

;zend_extension = "\xampp\php\ext\php_eaccelerator.dll"

;zend_extension = "\xampp\php\ext\php_xdebug.dll"

 

[MSSQL]

; Allow or prevent persistent links.

mssql.allow_persistent = On

 

; Maximum number of persistent links. -1 means no limit.

mssql.max_persistent = -1

 

; Maximum number of links (persistent+non persistent). -1 means no limit.

mssql.max_links = -1

 

; Minimum error severity to display.

mssql.min_error_severity = 10

 

; Minimum message severity to display.

mssql.min_message_severity = 10

 

; Compatibility mode with old versions of PHP 3.0.

mssql.compatability_mode = Off

 

; Connect timeout

;mssql.connect_timeout = 5

 

; Query timeout

;mssql.timeout = 60

 

; Valid range 0 - 2147483647. Default = 4096.

mssql.textlimit = 4096

 

; Valid range 0 - 2147483647. Default = 4096.

;mssql.textsize = 4096

 

; Limits the number of records in each batch. 0 = all records in one batch.

;mssql.batchsize = 0

 

; Specify how datetime and datetim4 columns are returned

; On => Returns data converted to SQL server settings

; Off => Returns values as YYYY-MM-DD hh:mm:ss

;mssql.datetimeconvert = On

 

; Use NT authentication when connecting to the server

mssql.secure_connection = Off

 

; Specify max number of processes. -1 = library default

; msdlib defaults to 25

; FreeTDS defaults to 4096

;mssql.max_procs = -1

 

; Specify client character set.

; If empty or not set the client charset from freetds.comf is used

; This is only used when compiled with FreeTDS

;mssql.charset = "ISO-8859-1"

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olha eu postei ai o que tinha de MSSQL la no php.ini .... mas o que tinha la eu tirei o comentario...

 

Problema resolvido... era o problema com a dll quando você instala o XAMMP...

 

 

I do not get any connection to my MS SQL server!

If the mssql extension was loaded in the php.ini, sometimes it comes to access problems when only TCP/IP is used.
 You can fix that problem with a newer "ntwdblib.dll" from Microsoft. Please replace the older file in "\xampp\apache\bin" and "\xampp\php"
 with the new one. Because of the license, we can't package a newer version of this file with XAMPP

 

ou seja desligue o servidor... depois va em \xampp\apache\bin e cole essa dll aqui ... ntwdblib.dll

 

inicie ele novamente e ver se vai conectar heheheeh,.... XD comigo funcionou....

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.