the following code can't take my data from database. what could be the problem. here's the sample code:

PHP Code:
<?php

mysql_connect
('localhost','root','1234') or die("Unable to connect to MySQL");
mysql_select_db(mris) or die("Unable to select a database");

$query "select mrisno,mdate from mrishead where mdate<'$datestart' and status='Approved' and appname<>'' and lastupdate>='$datestart'"

$result mysql_query($query) or die("Error in query");
if(
mysql_num_rows($result)>0)
{
   while(
$row=mysql_fetch_row($result))
   {
    echo 
$row['mrisno'].'<br/>';
    echo 
$row['mdate'].'<br/>';
   }        
}

?>
There's seems to be no problem or error message. when i try to replace $row['mrisno'] with $row[0] it works well. But i want it to be a fieldname not a number for me not to have a hard coding but this isn't working. what seems to be the problem? thank you in advance for any information guys..