You are here: Re: How to LIMIT results in html php/sql query? « PHP SQL « IT news, forums, messages
Re: How to LIMIT results in html php/sql query?

Posted by coolsti on 08/22/05 14:39

Regardless of whether your database is read only or not, sending the query
as a part of the URL is not a very good idea. Your database may be read
only today, but may not be tomorrow. Or someone can figure out some other
nice hack.

If you are using PHP and scripting anyway, why not have your php script
create the query statement. The script can take input in the form of POST
or GET variables, and based on this input form the correct query.

Simple example:

http://somewhere.com?mode=4

and then you have in your PHP code some snippet, like a switch statement:

$mode = trim($_GET['mode']);
switch ($mode)
{
case 1:
break;
case 4:
$query = " ...... " // your query here break;
default:
}

You can add extra variables as well if needed.

This technique would be far better from a programming standpoint, and then
you won't have the issues that you are having currently.

 

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

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