Jump to content

On insert, lookup word in table


Canman2005

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.