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

Posted by Jerry Stuckle on 10/07/62 11:55

mpar612 wrote:
> J.O. Aho wrote:
>
>>mpar612 wrote:
>>
>>>J.O. Aho wrote:
>>>
>>>>mpar612 wrote:
>>>>
>>>>
>>>>>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=:
>>>>
>>>>When looking at your example you don't provide this data at all and to make
>>>>things a lot easier I would include them into the form as hidden input-tags.
>>>>Things gets a lot easier if you keep on sending data in the same way and not
>>>>try to mix.
>>>>
>>>>
>>>> //Aho
>>>
>>>Thanks! Could you please elaborate a little bit more, I'm a beginner
>>>and I don't really understand what you are saying. I don't see how I
>>>am trying to mix the way that I am sending data.
>>>
>>>Thanks!
>>>
>>
>>You claim you are trying to use data sent as POST and GET at the same time,
>>thats a try in mixing, in your example you don't send anything that could be
>>fetched with $_GET.
>>
>>
>>--- send all as post ---
>><form method="POST" action="">
>><table>
>>
>><tr><td colspan="2" align="center">Yes <?php
>>input_radiocheck('radio','yes_no', $defaults, 'yes'); ?> No <?php
>>input_radiocheck('radio','yes_no', $defaults, 'no'); ?>
>></td></tr>
>>
>><tr><td colspan="2" align="center"><?php input_submit('save','Add'); ?>
>></td></tr>
>>
>></table>
>><input type="hidden" name="isbn" value="<?PHP echo $isbn; ?>" />
>><input type="hidden" name="artist_name" value="<?PHP echo $artist_name; ?>" />
>><input type="hidden" name="album_title" value="<?PHP echo $album_title; ?>" />
>><input type="hidden" name="_submit_check" value="1"/>
>></form>
>>--- end of example ---
>>
>>There you get all the data you needed to send, all sent as post.
>>
>>
>> //Aho
>
>
> Thanks, but I'm afraid that I don't understand why this needs to be
> done. I have variables, $isbn = $_GET['isbn'], $artist_name =
> $_GET['artist_name'] and $album_title = $_GET['album_title'] that are
> pulling information from the url:
> "www.domain.com/delete_record.php?isbn=1234567689&artist_name=&album_title=."
>
> I want to run the delete query "DELETE FROM lounge WHERE isbn = $isbn
> AND artist_name=\'$artist_name\' AND album_title=\'$album_title\'.
>
> The $_GET values work when I do a print $isbn etc... The delete query
> works in phpmyadmin when I specify hard values for isbn, artist_name
> and album_title. For example the following query works: DELETE FROM
> lounge WHERE isbn = 123456789.
>
> These things will not work together and I'm not sure why. I believe it
> is an issue with $isbn = $_GET['isbn'], $artist_name =
> $_GET['artist_name'] and $album_title = $_GET['album_title'] and
> inserting the variable names in the SQL query, but I'm not sure how
> this works. My books don't cover this specific problem in detail.
>
> Thank you very much for all of your help. I apologize if I'm asking
> too many questions.
>

As others have said - the problem is you're mixing GET and POST. You're
POSTing the form - but then trying to use GET to retrieve the values.

You can use one or the other - mixing both does not work well.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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