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
question about using sql server with php
Old 10-27-2008, 12:05 AM question about using sql server with php
Ultra Talker

Posts: 254
Trades: 0
i have a question about how to use sql database with php instead of using my sql database

when i use my sql database the php code to connect to the my sql database is =

$conn = mysql_connect($hostname, $user, $password);
if(!$conn)
{
echo "Unable to connect to Database";
}
else
{
mysql_select_db($database, $conn);
$query = mysql_query($selectquery);
mysql_close($conn);
}

if i have to connect to a sql databse instead of my sql database as some companies use sql database, how can i change the php code to connect, run a query and close connection to the sql database.

apart from changing the code to connect to sql database is there something else i need to do.

php my admin is used to access the tables in mysql database, which tool should be used to access data in the tables for sql database.

please advice.

thanks
sudhakararaog is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-27-2008, 12:30 AM Re: question about using sql server with php
lothop's Avatar
Ultra Talker

Posts: 303
Trades: 0
You would just need to change the username, password and hostname in order to connect to that database.

Also you would have to change the names of the tables etc. so your php pulls the data or puts the data into the right place, but only if they differ from a previous database
__________________
Websites Created;
warscope.com
ratepayers.org.nz

Last edited by lothop; 10-27-2008 at 12:31 AM.. Reason: ENGLISH
lothop is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to question about using 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 0.09696 seconds with 12 queries