473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

question about using sql server with php

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 =

Expand|Select|Wrap|Line Numbers
  1. $conn = mysql_connect($hostname, $user, $password);
  2.  
  3. if(!$conn)
  4. echo "Unable to connect to Database";
  5. }
  6.  
  7. else
  8. {
  9. mysql_select_db($database, $conn);
  10.  
  11. $query = mysql_query($selectquery);    
  12.  
  13. mysql_close($conn); 
  14. }

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
Oct 27 '08 #1
2 959
pbmods
5,821 Expert 4TB
Heya, Runway.

To operate on an MS SQL Server database, you'll be using either PHP's mssql (http://php.net/mssql) or odbc methods (http://php.net/odbc).
Oct 27 '08 #2
Markus
6,050 Expert 4TB
Runway27, we here at bytes.com pride ourselves on having a helpful, friendly and ever every-growing community. We ask of this community to follow a set of guidelines that are in place for your benefit. However, these guidelines are not always followed, and when they're not, we inform the user of the issue, point them to the guidelines and hope they see the light. Of course, this is not always how things turn out; the user may ignore all warnings and receive a temporary ban. All of the above is true in your situation.

Now, after a temporary ban comes a permanent ban, but we're not quick to throw around the banhammer on bytes.com; we want to be as helpful and guiding as possible without having to remove offenders. Ergo, it has been decided, in our good nature, to give you a final chance. Make no mistake: if you fail to use code tags, double post, or post outside of the guidelines again, you will be issued with a permanent ban.

I hope you will read the Posting Guidelines especially on 'how to ask a question'.

Moderator.
Oct 27 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
5
by: John | last post by:
Hi, I have an asp.net form where if the user enters an incorect date I change the color of the textbox to red and also display a label field with a message saying the date is invalid. What I...
2
by: Woody Splawn | last post by:
I have been using VB.net for stand alone and client/server kinds of things but am beginning to explore its use for web applications. I need to ask a couple of real basic questions. My...
2
by: Robert Smith jr. | last post by:
Hello, Please pardon my newbie question ... I am building an ASP.NET page that displays a recordset with a Delete statement enabled (this all works fine). I want to Insert the current row...
7
by: News | last post by:
Hello, I have to build a program with the future in mind and I need a bit of guidance from a guru or two. My program will start as a multi-user Windows Application built with VB.Net and using an...
13
by: Woody Splawn | last post by:
If this is not the right newsgroup for this question please direct me. I have been using VB.net for stand alone and client/server kinds of things but am beginning to explore its use for web...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.