Browse a Listing
Top > PHP > Tips and Tutorials > Database-Related
Popular Tags
Free Script links
Member Reviews
Visitor Ratings
Google PR
In this article, I will explain how it is possible to connect and query an MS SQL server (running under a Windows operating system) from php installed on a unix box. The same problem, in the case of php installed under Windows is not covered here because it is well explained in php FAQ; sadly I cannot say the same thing for the unix case. In fact, there is a multitude of incorrect or outdated sources of information which will cause new people trying to solve this problem to drop it after some bad tries. This article can also be of help to people who don't want to use php as a client.
Category:
Write a Review
Add Favorite
Refer it to Friend
Report Broken Link
Date Added: Oct 15, 2006 Hits: 2 Rating: 0.00 Votes: 0
Member Reviews
Visitor Ratings
Google PR
Connecting to a mySQL database through PHP first requires knowing what a few parameters are. I suggest making these parameters variables that you can easily change, so that if these parameters change you don't have to go in and alter hundreds (or worse thousands) of mySQL connections inside your scripts. Keep these variables in a setup file and require it or at the very top of scripts you write so you can change them.
Category:
Write a Review
Add Favorite
Refer it to Friend
Report Broken Link
Date Added: Oct 15, 2006 Hits: 3 Rating: 0.00 Votes: 0
Member Reviews
Visitor Ratings
Google PR
Member Reviews
Visitor Ratings
Google PR
We use following MySQL functions in this example:
mysql_connect - connects to MySQL server
mysql_select_db - select database
mysql_query - send query
mysql_num_fields - get number of fields
mysql_fetch_field - get field information
mysql_query - send query
mysql_fetch_row - get current row from result table
mysql_free_result - free result table from memory
Category:
Write a Review
Add Favorite
Refer it to Friend
Report Broken Link
Date Added: Oct 25, 2006 Hits: 5 Rating: 0.00 Votes: 0
Member Reviews
Visitor Ratings
Google PR
Member Reviews
Visitor Ratings
Google PR
Member Reviews
Visitor Ratings
Google PR
At first we connect to a MySQL database and use the SHOW TABLES command to return all the tables in the database. Next, we iterate over each table and return the fields for each table using the SHOW FIELDS command. Finally, we put all of the returned information into XML.
Category:
Write a Review
Add Favorite
Refer it to Friend
Report Broken Link
Date Added: Feb 20, 2007 Hits: 15 Rating: 0.00 Votes: 0
Member Reviews
Visitor Ratings
Google PR
Member Reviews
Visitor Ratings
Google PR
Learn how to create an object oriented database abstraction class for MySQL database. Besides the basic functions this manager class can summarize total time spent with db connection and query execution and counts how many query were executed during your PHP script.
Category:
Write a Review
Add Favorite
Refer it to Friend
Report Broken Link
Date Added: Apr 1, 2007 Hits: 4 Rating: 0.00 Votes: 0
Member Reviews
Visitor Ratings
Google PR