Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
help: connecting sql server with php
Old 03-21-2008, 09:44 PM help: connecting sql server with php
Novice Talker

Posts: 8
Name: Allan
Trades: 0
si there a way on how to connect "sql server"(not mysql..) with php?

pls help need this badly.

pls add the codes to.. thanks
wheay is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-21-2008, 10:57 PM Re: help: connecting sql server with php
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
What kind of sql database are we talking about here? If it is a mssql server then take a look at this:
http://us2.php.net/mssql

PHP 5.1+ also has PDO built in for accessing a database in a more generic way.
http://us3.php.net/pdo
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 03-22-2008, 08:47 AM Re: help: connecting sql server with php
Novice Talker

Posts: 8
Name: Allan
Trades: 0
Quote:
Originally Posted by NullPointer View Post
What kind of sql database are we talking about here? If it is a mssql server then take a look at this:
http://us2.php.net/mssql

PHP 5.1+ also has PDO built in for accessing a database in a more generic way.
http://us3.php.net/pdo
thanks for the help..
but i think the codes are different when connecting using mysql..(?)

one more question:
are the codes in mysql and mssql server different?
and do i need to download the .dll files? for the php.ini..
your a big help to me..

im just a noobe to this..sorry for the questions..
wheay is offline
Reply With Quote
View Public Profile
 
Old 03-22-2008, 03:57 PM Re: help: connecting sql server with php
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
The functions for connecting to a mysql and an mssql database are different, as are the functions for querying those databases. PDO abstracts away from that only so far as connecting and querying a database. That, however may be all that you need considering that SQL is roughly the same no matter what database you are using. It is possible that a query in mssql be identical to a query in mysql, you need only be concerned when a query utilizes a database feature that exists in one but not the other.

PDO, mysql, mssql and a few other database functions are built into php (5.1 or higher for pdo) so you do not have to make any changes to the php.ini or install any dlls to make them work.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 03-23-2008, 04:26 AM Re: help: connecting sql server with php
Novice Talker

Posts: 8
Name: Allan
Trades: 0
Quote:
Originally Posted by NullPointer View Post
The functions for connecting to a mysql and an mssql PDO, mysql, mssql and a few other database functions are built into php (5.1 or higher for pdo) so you do not have to make any changes to the php.ini or install any dlls to make them work.
wow! you gave me hope.. :-)
uhmmmm.. can i ask for a code in connecting this 2? im sorry if i ask to much.. i think your the only one who can help me.. just the code in connecting the mssql server with php.. thanks. if its ok with you.. thank you so much..
wheay is offline
Reply With Quote
View Public Profile
 
Old 03-26-2008, 10:47 PM Re: help: connecting sql server with php
Novice Talker

Posts: 11
Name: Tortoise
Trades: 0
I am having the same problem
Tortoise is offline
Reply With Quote
View Public Profile
 
Old 03-27-2008, 02:00 AM Re: help: connecting sql server with php
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Documentation:
http://us2.php.net/manual/en/function.mssql-connect.php

You'll need to have a database setup to begin with and you'll need the server name or address, a valid username and password.
PHP Code:
$server 'SERVERNAME';
$username 'user';
$password 'pass';

mssql_connect($server$username$password); 
From there you will have to select the database you're interested in use the mssql commands built into php to work with the database. Read through the documentation for a list of commands and how to use them:

http://us2.php.net/mssql
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to help: connecting sql server with php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 3.84557 seconds with 12 queries