hi please help me to rid of these following warnings in following php script
Actually this script is running smoothly on my local window server, but on mu linux hosted server following warnings are coming..
Please see
please please please help me..
-------------------------------------Warnings-------------
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/compkcom/public_html/cmpanel/check_login.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /home/compkcom/public_html/cmpanel/check_login.php:11) in /home/compkcom/public_html/cmpanel/check_login.php on line 19
-----------------------------------------------------------------
here goes the script
---------------------------------------------------php script--------------------
<?php
session_start();
?>
<?php
if((isset($_POST['username'])&&$_POST['username']!="")&&(isset($_POST['password'])&&$_POST['password']!="")){
$error='';
$conn = mysql_connect('localhost','compkcom_care','ptk')or die('Could not connect to MySQL database. ' . mysql_error());
mysql_select_db(SQL_DB,$conn);
$query = "SELECT COUNT(username) AS record FROM admin WHERE username ='" . $_POST['username']."' AND password = '".$_POST['password']."'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
if($row['record']==1){
$_SESSION['user_logged'] = $_POST['username'];
$_SESSION['user_password'] = $_POST['password'];
header("location:welcome.php");
}
else{
$error .="Please+Enter+Correct+Username+and+password%21%0D%0A";
header("location:index.php?&error=".$error);
}
}
else{
$error .="Please+Enter+the+Username+and+password+First%21%0D%0A";
header("location:index.php?&error=".$error);
}
?>
-----------------------------------------------------