You are here: Re: Delete Script « PHP SQL « IT news, forums, messages
Re: Delete Script

Posted by mpar612 on 08/11/06 20:44

J.O. Aho wrote:
> mpar612@gmail.com wrote:
> > Hi everyone,
> >
> > I appreciate all of your help with me and the problems I have been
> > having. I'm new to PHP and MySQL and I'm having some problems getting
> > this script to work. I can't get this to work and I don't understand
> > why. I don't get an error or anything, it almost seems like the page
> > refreshes. I went to the phpmyadmin and the row is still in the
> > database. The $_GET parts work perfectly in another script and the SQL
> > statement works when I insert hard values in it. Any thoughts would be
> > greatly appreciated. Thanks in advance.
>
>
> > <form method="POST" action="<?php print $_SERVER['PHP_SELF']; ?>">
> > $isbn = $_GET['isbn'];
> > $artist_name = $_GET['artist_name'];
> > $album_title = $_GET['album_title'];
>
> The form method is POST, then
> $_GET['isbn']=$_GET['artist_name']=$_GET['album_title']=NULL
> use $_POST['isbn'], $_POST['artist_name'] and $_POST['album_title'].
>
> You can simplify your form tag, action="" is the same as calling itself, less
> code and less work for PHP if you use:
>
> <form method="POST" action="">
>
>
> > $delete_sql = "DELETE FROM lounge WHERE isbn = $isbn AND artist_name =
> > \'$artist_name\' AND album_title = \'$album_title\'";
>
> $delete_sql = "DELETE FROM lounge WHERE isbn = $isbn AND artist_name =
> '$artist_name' AND album_title = '$album_title'";
>
> Remember that the column isbn has to be INT.
>
>
>
> //Aho

Thanks! I should have mentioned that the following is required because
they are being pulled form the url
www.domain.com/delete_record.php?isbn=123456789&artist_name=Mike&album_title=:

> $isbn = $_GET['isbn'];
> $artist_name = $_GET['artist_name'];
> $album_title = $_GET['album_title'];

I shouldn't use $_POST should I?

Thanks!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация