Hi all,
Should be a simple query but i can't get it to work.
I will add that i'm usung this query to put into flash.
Here's the code:
$table = $HTTP_POST_VARS['tab'];
$condition = StripSlashes($HTTP_POST_VARS['cond']);
$qr = mysql_query("SELECT * from ".$table.($condition=="" ? "" : " WHERE ".$condition));
$r_string = 'n='.mysql_num_rows ($qr);
$i = 0;
while ($row = mysql_fetch_assoc ($qr)) {
while (list ($key, $val) = each ($row)) {
$r_string .= '&' . $key . $i . '=' . $val ;
}
$i++;
}
// without extra &, this is returning extra chars at the end
echo $r_string.'&';
What i'm wanting to do is add
ORDERBY lastName
to the query.
Any ideas?
Cheers,
micmac