Bonjour , je cherche désespérement a faire marche php avec sql server , j'ai activé l'extension dans php mais rien a faire je n'arrive pas a me connecter, j'ai pensé a un probleme dans la config d'sql server mais non tout vas bien , j'ai fait un script perl pour tester la connexion tout marche bien il peut ce connecter et effectuer des opérations.
J'ai essayé de me connecter avec Easyphp , Wamp, Apache tout seul + php, IIS +php rien a faire sa veut pas j'ai mis la dll ntwdblib.dll au bonne endroit marche pas non plus
Je m'arrache les cheveux
voici mon script php de connextion
comme nom de serv j'ai testé : VISTA\SQLEXPRESS , 127.0.0.1, localhost
merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 <?php function sql_db($sqlserver, $sqluser, $sqlpassword, $database) { $this->user = $sqluser; $this->password = $sqlpassword; $this->server = $sqlserver; $this->dbname = $database; $this->db_connect_id = mssql_connect($this->server, $this->user, $this->password); if( $this->db_connect_id && $this->dbname != "" ) { if( !mssql_select_db($this->dbname, $this->db_connect_id) ) { mssql_close($this->db_connect_id); return false; } } return $this->db_connect_id; } # VISTA\SQLEXPRESS $i = sql_db("127.0.1","sa","gnarf2rt","site"); print "=============\n"; print "$i\n"; ?>
Partager