09/10/2018, 18:11
Xin code PHP & Sql Server ?
Các bác có bác nào đã từng xây dựng web bằng PHP với CSDL Sql Server, xin cho tớ một ít code để tớ tham khảo, vì tớ mới bắt đầu học lập trình Web.
Mong mọi người chiếu có cho. Email lehuong98t@yahoo.com
Mong mọi người chiếu có cho. Email lehuong98t@yahoo.com
Bài liên quan
$strServerName = "localhost";
$strUserName= "sa";
$strPassword= "";
$strDatabaseName= "test";
if( mssql_connect($strServerName, $strUserName, $strPassword))
{
mssql_select_db($strDatabaseName);
$strTempQuery = "SELECT * FROM Products";
$result = mssql_query($strTempQuery);
mssql_close();
}
else
{
echo("Can not connect to database");
}
Nói chung là khá giống mysql bạn chỉ cần thay chữ mysql thành mssql là được
Vào đấy mà xem, 1 đống Code luôn
Cái này có thể giúp bạn được đấy:
http://www.hotscripts.com/Detailed/18290.html
ezSQL - A class that makes it ridiculously easy to use mySQL, Oracle8, Inerbase/Firebase, PostgreSQL, SQLite (PHP), SQLite (C++) and/or MS-SQL database(s) within your PHP/C++ script. Includes lots of examples making it very easy to understand how to work with databases.