Reply to Re: Problem with SELECT

Your name:

Reply:


Posted by totalstranger on 08/29/06 01:29

On or about 8/27/2006 4:11 PM, it came to pass that Anne Bos wrote:
> I have a database where authors are listed together with articles they
> wrote in a little journal. I want to present people what author has
> produced what articles. In order to do that I made a form, adressing a
> file called authors.php. If someone gives in a name of an author,
> his/her name as well as his/her articles are listed as expected. So
> far no problems.
> However, if no name is given or if just return is hit, the querry
> gives all authors. In that case I want no author being given back,
> instead I prefer to give a sentence: "Please give the name of a
> possible author".
>
> The relevant items are (within php of course):
> $search = $_POST[author];
> and
> $sql="SELECT (the relevant field names) FROM journal WHERE author LIKE
> '%$search%' ORDER BY idart";
> (idart gives a chronological numbering of all articles)
>
> What should I do? Any hint is appreciated.
>
> Anne Bos

On the return problem. Assuming you are using a SUBMIT button to post
the entered data: set up a dummy hidden submit button before the first
entry field. It will force the browser to send this button and handle
the enter key problem. (you can also do the style in-line)

<style type="text/css" media="screen">
#HideBtn {Display: None;}
</style>

<input type="submit" name="Submit" value="EnterKey" Id="HideBtn" />

[Back to original 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

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