A field in mysql table "server_var_dump" which contains many details including USER_AGENT of the visitors of site. Now I only need USER_AGENTs containing line. Now I have written following script to match the USER_AGENT of the output string. Now I need to print only those lines which contains the USER_AGENT
$result = mysql_query("SELECT server_var_dump FROM pageviews LIMIT 0,10");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
//printf("%s", $row["server_var_dump"]);
if(preg_match("/[USER_AGENT]/", $row["server_var_dump"])){
echo "match found.";
}
else
echo "No matches found";
}
Please suggest me how do I print the line which contains USER_AGENT?
Thanks!