Re: Result sorting not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Shirah wrote:
> I have a search page that displays all active records in my application,
> but
> for some reason, I can not get it to display based on a specific input.
> 
> For instance, I have records with id's 2, 3, 4, 5 etc...  In my search
> form,
> the default view shows all records, and my form variable lets you put in
> different search criteria.  If I do a search by id and put in "2" as the
> search condition, my results keep coming back blank.  It does not matter
> which parameter or value I put in, it still returns blank.
> 
> Any ideas?

you don't bother to read your own code thoroughly? see below:

> 
> <?php
> $connection = mssql_connect($host, $user, $pass) or die ('server connection
> failed');
>  $database = mssql_select_db("$database", $connection) or die ('DB
> selection failed');
> 
> 
>  // Query the table and load all of the records into an array.
>  $query = "SELECT
>     child_support_payment_request.credit_card_id,
>   credit_card_payment_request.credit_card_id,
>   credit_card_payment_request.date_request_received
>    FROM child_support_payment_request,
>         credit_card_payment_request
>      WHERE child_support_payment_request.credit_card_id =
> credit_card_payment_request.credit_card_id";
> if ($request_id !== '') {
>    $query.=" AND credit_card_payment_request.credit_card_id =
> $request_id2";

$request_id AND $request_id2 ??

>    }
> if ($dateTime !== '') {
>   $query.=" AND credit_card_payment_request.date_request_received =
> $dateTime2";

$dateTime AND $dateTime2 ??

...

ecified in a seperate
> chunk of
> php code, but are still included on the same page as the code below.  Am I
> right in assuming that any variable set on the same page can be carried
> into
> different php blocks on the same page?
> 
> Example:
> 
> <?php
> 
> $id = $_POST['request_id']
> 
> ?>
> 
> <?php
> 
> echo "<table>";
> echo "<td>"'
> echo $id;
> echo "</td>";
> echo "</table>";
> 
> ?>
> 
> That would be valid, correct?

yes.

> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux