o.O didnt say the first one.
haha ok
Here i am using this one. its MSSQL
PHP Code:
<?php
class MSSQL
{
private $_link;
public function connect($server='', $username='', $password='', $new_link=true)
{
$this->_link = mssql_connect($server, $username, $password, $new_link);
}
public function Escape($string)
{
return str_replace("'", "''", $string);
}
public function query($query) {
return mssql_query($query, $this->_link);
}
public function fetchArray($result, $array_type = MYSQL_BOTH) {
return mssql_fetch_array($result, $array_type);
}
public function fetchRow($result) {
return mssql_fetch_row($result);
}
public function fetchAssoc($result) {
return mssql_fetch_assoc($result);
}
public function fetchObject($result) {
return mssql_fetch_object($result);
}
public function numRows($result) {
return mssql_num_rows($result);
}
public function close() {
return mssql_close($this->_link);
}
}
//Example
//Select DB
$db->query('USE ACCOUNT_DBF');
//Getting data
$result = $db->query('SELECT account,password FROM ACCOUNT_TBL WHERE account = "accountname"');
//Fetching the data
echo $db->fetchAssoc($result);
?>