It doesn't seem that you have declared the vars $reorder and $order, so that
will make a bad query.

"Mayo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> PROBLEM
>
> I'm trying to insert information from a query string into sql.
>
> I have a table with content. The column headers have up and down arrows
> allowing the user to sort and order by that column.
>
> PHP
>
> I have default settings set for the variables.
> If I change the default values the SQL results changes. (good)
> I can get the query string variables outside the sql.
>
> <?php print "$category $section"; ?>
>
> However I can't seem to insert the query string variables into the sql.
>
> <?php
>
> function whatever(){
>
> $username = "";
> ...
>
> // setting the default variables
>
> if(!isset($category)){$category="Something";}
> if(!isset($section)){$section="SomethingElse";}
>
> [EMAIL PROTECTED]($hostname,$username,$password);
> mysql_select_db($database);
> $selection = mysql_query("
> SELECT *
> FROM classes
> WHERE
> classCategory = '$category'
> ORDER BY $reorder $order
> ")
>
> ...
>
> ?>
>
> What am I missing here?
>
> thx,
>
> Gil

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

Reply via email to