Canman2005 Posted April 9, 2007 Share Posted April 9, 2007 Hi all I have a insert query which looks like if (isset($_GET['action']) == 'addmsg') { $forumsgaddsql = "INSERT INTO `forum` SET type = 4, message = '".$_GET['message']."'"; $forumsgaddquery = mysql_query($forumsgaddsql); print"<script>document.location='index.php'; </script>"; exit(); } This inserts some data into my table 'forum'. I then have another table called "swear", a sample of this table is words < FIELD NAME ------ test1 test2 test3 What I want to do, is before the INSERT query runs, check the output of any of the words in $_GET['message'] against all the words in the "swear" table and then return a COUNT for the total number of words matched. Can this be done? I'm sure i've seen it done before, but I cannot remember how to do this. Any help would be great Thanks Ed Link to comment https://forums.phpfreaks.com/topic/46211-on-insert-lookup-word-in-table/ Share on other sites More sharing options...
neel_basu Posted April 9, 2007 Share Posted April 9, 2007 $sql = "select `words` from `table_name` where `words` like '%$_GET['message']%'" Link to comment https://forums.phpfreaks.com/topic/46211-on-insert-lookup-word-in-table/#findComment-224752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.