473,385 Members | 1,606 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,385 software developers and data experts.

MSSQL arguments in PHP

Hello!

I am not at all good at sql, so can anyone tell me what this error i get means.......

Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource in d:\WebHoteller\printline\www\bacon\login.php on line 19

Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in d:\WebHoteller\printline\www\bacon\login.php on line 20

Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource in d:\WebHoteller\printline\www\bacon\login.php on line 30

Warning: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource in d:\WebHoteller\printline\www\bacon\login.php on line 31

My login.php file:

session_start();
$badID = false;
session_register("LoggedIn");
$_SESSION['LoggedIn'] = true;
$cUser = "";
if (isset($_COOKIE['cUserLogin'])) {
$cUser = $_COOKIE['cUserLogin']; }
if(!empty($_POST['key'])) {
$a = $_POST['txtUserID'];
$b = $_POST['txtPassword'];
include("./connopenphp2.inc");
session_register("UserID");
$_SESSION['UserID'] = $a;
$_SESSION['Password'] = $b;
session_register("Password");

$query = "select * from SysParms";
Line 19 $result = mssql_query($query,$conn);
Line 20 $SysParms = mssql_fetch_array($result);
session_register("WebCompanyName");
$_SESSION['WebCompanyName'] = trim($sysparms['WebName']);
session_register("WebName");
$_SESSION['WebName'] = trim($sysparms['WebName']);
session_register("DisplayState");
$_SESSION['DisplayState'] = Trim($sysparms['DisplayState']);

$errormessage = "";
$query = "select * from USERINFO where (UserID = '" . $a . "' and Password = '" . $b . "')";
Line 30 $result = mssql_query($query,$conn);
Line 31 if (mssql_num_rows($result) > 0) {
$userinfo = mssql_fetch_array($result);
if (trim($userinfo['UserActive']) == 'I') {
$errormessage = "Your Login ID has not been activated yet. Please try later.";
$badID = true;
}
if ($userinfo['UserActive'] != 'I') {
if (@$_POST['chkSaveCookie'] == "ON") {
setcookie("cUserLogin", $a);
} else {
setcookie("cUserLogin", "");
};
session_register("SalesRepID");
$_SESSION['SalesRepID'] = $userinfo['SalesRepID'];
session_register("ShowDetails");
$_SESSION['ShowDetails'] = $userinfo['ShowMoveDetails'];
$_SESSION['LoggedIn'] = true;
session_register("CurrentlyLoggedInUser");
$_SESSION['CurrentlyLoggedInUser'] = $userinfo['FirstName'] . " " . $userinfo['LastName'];
@include("search0.php");
return;
}
}
else {
$badID = true;
}
}
Sep 26 '06 #1
0 4116

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

Similar topics

11
by: badz | last post by:
Hi frenz Lately I try to use MSSQL and PHP , the problem arise when PHP try to read MSSQL field with 'image' data type, header("Content-type: image/jpeg"); // act as a jpg file to browser I...
7
by: mj | last post by:
Hello, thanks for the help. I am running a WinXP Pro w/ SP2 (my home computer, with ZoneAlarm firewall) Apache 2.0.52 MySQL 4.1.7 PHP 5.1.0-dev I have developed a PHP/MySQL web app that...
1
by: JackTorrance | last post by:
Hi i have a problem with IIS6 and MSSQL and i hope that someone can help me. this is the configuration: Windows 2003 IIS6 MSSQL 7.0 Standard Edition ADO 2.5
14
by: Kukurydz | last post by:
I've got such problem: My database is stored on MSSQL Server. I have to write reports for it in MSAccess. I've got a problem with creating a query which will select records from MSSQL table with...
3
by: gharmel | last post by:
I'm trying to get some clues on why I get (much) slower responses from my PHP applications when dealing with a remote sql server as opposed to a local sql server. Here's my situation: Server...
11
by: ralphie | last post by:
hi all since nearly 2 days i fight with mssql and utf-8 as i need to store and retrieve arabic characters. i tried the com approach ...
2
by: jblankenburg | last post by:
Please help! I am hunting high and low for an equivalent function for MSSQL's DATENAME function. Here's the spec on the function from MSSQL's Books Online: DATENAME Returns a character...
0
by: DariuszK | last post by:
I am greeting I would like to consult the better solution(with security consideration) to the access is for MSSQL(2005) from ASP(Classic) in the system of the intranet. a) SQL mixed mode and...
0
by: Derftics | last post by:
Hi Guys, Is there anyone who have tried installing MSSQL 2000 and MSSQL 2005 servers in one desktop computer? I have tried using MSDE and successfully install the MSSQL 2000 server but when I...
14
by: guswebb | last post by:
Hi. I'm a newbie to PHP and am having a few problems as follows... I have installed PHP successfully on server 1 which is running IIS 6 (W2k3) and hosting multiple sites, some of which connect to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.