Re: Filtering Data

From: Date: Thu, 30 Jun 2005 12:42:21 +0000
Subject: Re: Filtering Data
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-39823@lists.php.net to get a copy of this message
That sounds like it, but help me a step further as I work from a template and haven't fully absorbed the syntax. My basic query is: $get_data_query = "select a, b, c from table order by $sort_field $sort_order"; Where do I put the syntax you suggest? Where do the words go on which to click to execute? Also, I forgot that I'm using is zip codes to define states, so I'm doing, for example, 39999 > z > 29999 Thanks ********** On Thu, 30 Jun 2005 08:17:17 -0400, Ross Honniball <ross@bookshop.jcu.edu.au> wrote:
Sounds like you just want some pretty basic variable substitution? As in the page is submitted with, say, state=T and you need to code your select statement like eg: $query = "SELECT * FROM tbl WHERE state = '".$_REQUEST['state']."'"; then execute this query in your DB call. Does that help? kc68@cornell.edu wrote:
How do I write a link which results in a page with part of the data in the mysql table and do that multiple times on a single php script page? That is, I want to be able to click on state names on a single page and bring up a page with only that state's data. I understand use of the "where" limitation, but I don't see how to code a line which will override the base "select" statement for the script. Thanks. Ken


« previous php.db (#39823) next »