bilis_money Posted August 10, 2006 Share Posted August 10, 2006 it works but i can't see the results or record?after the query,the codes,[code]<?php//search record for topic records.session_start();require_once ("opendb.php");require_once ("error_messages.php");$COerr_msgs = new error_messages; //instantiate object//get variables from form $topic_new = $_POST['topic']; $_SESSION['topic']=$topic_new;//select record $query = "SELECT * FROM topics WHERE title='$topic_new'"; //get record from table $result = mysql_query($query); $chk_dup = mysql_fetch_array($result);//retrieving old title $title_old = $chk_dup[title]; //fetch from table $descrip_old = $chk_dup[description]; $url_old = $chk_dup[url]; //compare and search new_topic with old_topic using REGEX if(preg_match("/\b$topic_new\b/i", $title_old)) { //display all data records using paging. echo "ok match found!<br>"; echo $title_old, "<br>"; echo $descrip_old, "<br>"; echo $url_old; } else { $COerr_msgs->err_msgs('search1'); }?>[/code] Quote Link to comment Share on other sites More sharing options...
bilis_money Posted August 10, 2006 Author Share Posted August 10, 2006 i'm just wondering if my preg_match() here works fine?[code]if(preg_match("/\b$topic_new\b/i", $title_old))[/code]specially the insertion of the $topic_new inside preg_match and $title_old?any good advice?GOD bless u for your hep in advance. Quote Link to comment Share on other sites More sharing options...
king arthur Posted August 10, 2006 Share Posted August 10, 2006 Well, what do you see? How do you know it works? Quote Link to comment Share on other sites More sharing options...
bilis_money Posted August 10, 2006 Author Share Posted August 10, 2006 what i mean works, is i don't see any error.but after the execution it is showing nothing just PLAIN WHITE WEB PAGE.no error, no messages, no output result, nothing?any nice guess from you guys? Quote Link to comment Share on other sites More sharing options...
hostfreak Posted August 10, 2006 Share Posted August 10, 2006 Try:[code]<?php//search record for topic records.session_start();require_once ("opendb.php");require_once ("error_messages.php");$COerr_msgs = new error_messages; //instantiate object//get variables from form $topic_new = $_POST['topic']; $_SESSION['topic']=$topic_new;//select record $query = "SELECT * FROM topics WHERE title='$topic_new'"; //get record from table $result = mysql_query($query) or die(mysql_error());//retrieving old title while ($chk_dup = mysql_fetch_array($result)) { $title_old = $chk_dup["title"]; //fetch from table $descrip_old = $chk_dup["description"]; $url_old = $chk_dup["url"]; } //compare and search new_topic with old_topic using REGEX if(preg_match("/\b$topic_new\b/i", $title_old)) { //display all data records using paging. echo "ok match found!<br>"; echo $title_old, "<br>"; echo $descrip_old, "<br>"; echo $url_old; } else { $COerr_msgs->err_msgs('search1'); }?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.