For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Thursday, August 14, 2014

PHP with MSSQL Server Simple Query

PHP with MSSQL Server Simple Query.

<?php
session_start();
$sqlServerIP = '127.0.0.1';
$link = mssql_connect($sqlServerIP, 'sa', 'amit123');
if (!$link) {
    die('Wrong connection');
}

mssql_select_db('AssetMgmt', $link);
$User_Email="email@email.com";
$User_Pass='test';
$ssql="select *from USER_MASTER where User_Email='".$User_Email."' and User_Pass='" .$User_Pass ."'";
$result = mssql_query($ssql);
$numrow=mssql_num_rows($result);
if (!mssql_num_rows($result)) {
    echo 'Login/Pass is invalid';
}
else
{
    echo '<ul>';
    while ($row = mssql_fetch_assoc($result)) {
        echo '<li>' . $row['Name'] . ' (' . $row['EmpID'] . ')</li>';
    }
    echo '</ul>';
}
mssql_free_result($result);
?>
Share:

0 comments:

Post a Comment

Multiple attribute passing in querySelectorAll

Multiple attribute passing in querySelectorAll     Here I am demonstrating code to how to pass multiple attributes in querySelectorAll. <...

Ads Inside Post

Powered by Blogger.

Arsip