martinthurn
New member
Your question is nonsequitur given this code. This program dies if it can not create the table; in other words, if the table already exists, the program will just die. Therefore it is impossible for an entry to already be in the table, as you ask.
But if you intend to massively overhaul this program... Just take a step back from the Perl code and figure out how you would do it in SQL -- after all, the Perl program is just sending SQL to the database! So, first you query for the data in question. If you get an answer, you know the entry is already there so you do UPDATE. If you get no answer, the entry is not there so you do an INSERT.
But if you intend to massively overhaul this program... Just take a step back from the Perl code and figure out how you would do it in SQL -- after all, the Perl program is just sending SQL to the database! So, first you query for the data in question. If you get an answer, you know the entry is already there so you do UPDATE. If you get no answer, the entry is not there so you do an INSERT.