in reply to Re: Search a SQL Table and Delete Records
in thread Search a SQL Table and Delete Records
Will this work for retrieving the two columns I want?
# Search the needed table and pull out needed columns my $search = "SELECT comment_ID,comment_content FROM wp_comments" my $sql = $db->prepare($search); $sql->execute(); # Input fetched data into an array my @retrievedData = ""; while (my @row = $sql->fetchrow_array()) { push @retrievedData, [@row]; }
If that does I'm still trying to figure out how to search through the results. I only need to search through comment_content, and if a keyword is found, use the comment_ID to delete that row.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Search a SQL Table and Delete Records
by poj (Abbot) on Aug 30, 2014 at 18:06 UTC | |
by Anonymous Monk on Aug 30, 2014 at 18:25 UTC | |
by Katanya (Novice) on Sep 20, 2014 at 07:06 UTC |