preg match
| From: | Chandana Bandara | Date: | Fri, 07 Jan 2005 18:37:34 +0000 |
| Subject: | preg match | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-205859@lists.php.net to get a copy of this message | ||
This php script perform matching text of some certain URLs. but in this preg_match it wont match few
patterns < _ .
with help of this script , can some body help me to match the other all patterns .............plz ?
<?php
$user="root";
$pass="****";
$db="aa";
$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 indexNo,Reply from Acknowledgement order by
indexNo") 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("/$chk_msg/", "$msg", $match) ) {
// match found
$SQL="update Status set Status = 'UP' where
ServiceNo=".$rset["ServiceNo"];
mysql_query ("$SQL") or die ("Invalid 2nd query");
}else{
// SERIVCE DOWN
// nothing to do here.
//echo "No match..<br>";
}
}
mysql_close($dblink);
?>
thanx in advance,
chandana