I have a text area field that will handle citation keywords (much like blog tags) where each keyword will be separated by a line break (\n.) My question is, on the execute page, how would I go about separating the text area data and posting it to the database. I am sure it will take a while loop...
Here is my form code:
Code: Select all
<label for="keywords">Keywords:</label>
<Textarea name="keywords" cols="30" rows="2"></textarea><br />
Code: Select all
$sql="INSERT INTO wfbiblio.keywords (keyword) VALUES ('$keywords')";
$result = mysql_query($sql) or die(mysql_error());
$new_keyword_id = mysql_insert_id(); //retrieves publisher_id_
$sql="INSERT INTO wfbiblio.keyword_link (keyword_id, citation_id) VALUES ('$new_keyword_id','$new_citation_id')";
$result = mysql_query($sql) or die(mysql_error());