hi 

When i try to compile this code it gives following error.....
<b>Fatal error</b>:  Only variables can be passed by reference in 
<b>/var/www/html/hello/test.php</b> on line <b>16</b><br />

I have defined variable for to match some string patterns / symbols.
when i execute that code for   preg_match , gives this fatal error .

<?php

$user="root";
$pass="pass";
$db="database";
$pattern="[ _  :< ] >";
       
         $dblink = mysql_connect("localhost:3306", "$user", "$pass")or 
die("Could not connect to db");
         mysql_select_db($db) or die ("can't select the db");
        
         $result = mysql_query ("select ServiceNo,Reply from Acknowledgement 
order by ServiceNo") or die ("Invalid query");
         while ( $rset= mysql_fetch_array($result)) {
                /* Lets check the reply with the database*/
                $chk_msg= $rset["Reply"];
                //echo "checking $chk_msg in $msg<br>";
                if ( preg_match("$pattern","/$chk_msg/","$msg", $match) ) {
                        // match found
                        $SQL="update ServiceStatus set Status = 'UP' where 
ServiceNo=".$rset["ServiceNo"];
                        mysql_query ("$SQL") or die ("Invalid 2nd query");
                }else{
                        
                }

        }
        mysql_close($dblink);

?>

how can i prevent this problem ???


Thanx in advance
chandana

Reply via email to