Gossamer Forum
Home : General : Perl Programming :

select/ delete

Quote Reply
select/ delete
Does anyone know how to take out abit of the line:

$root_name = httpd/html/lyrics

I want it to just display lyrics [oh and the /lyrics bit changes that's why i need to do it].

I was also wondering how I change the following so that it deletes the record where songname = "$FORM{'songname'}" and filetype = "$FORM{'filetype'}":

DELETE FROM tabs_db WHERE songname = '$FORM{'sec'}' ......

I'd be greatful for your help thanks

Last edited by:

nfpunk: Mar 31, 2002, 3:50 PM
Quote Reply
Re: [nfpunk] select/ delete In reply to
Like I already told ya...ya need to use single quotes for the query....

Example:

Quote:

DELETE FROM TABLENAME
WHERE (SongName = '$FORM{'somefield'}') AND (FileType = '$FORM{'filetype'}')


BTW: You might want to consider using CGI.pm and then use the following codes:

Quote:

my $songname = $in->param('SongName');
my $filetype = $in->param('FileType');


Then replace your FORM parse codes with $songname and $filetype.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [nfpunk] select/ delete In reply to
>>
Does anyone know how to take out abit of the line:

$root_name = httpd/html/lyrics

I want it to just display lyrics [oh and the /lyrics bit changes that's why i need to do it].
<<


Could you explain? Im not sure wht you mean.
Quote Reply
Re: [Paul] select/ delete In reply to
Oh yeah I did rememeber to replace the " with ' I don't know why it's still there.

Oh and the other thing what I need to do is delete the file located at httpd/html/bandname/filetype/songname.txt I also need it to delete the mysql information which stores the the songname and the filetype. It is important that I don't just delete it where the songname = songname because I may have a guitar tab and drum tab for that song with the same songname.

I know how to get the songname.txt bit filtered out but not too sure on the filetype. If I can do that then I can delete the correct file from the mysql database.

Thanx for your help already.