On Mon, 10 Jun 2002 18:05:50 +0300, Hytham Shehab wrote:
> i got a simple question, why (1) is valid, however, (2) is not ?!!
> (1) sorting order is explicity typed in the query statement:
> $sth = $dbh->prepare("select student_name from students order by
>first_name
> asc");
> $sth->execute();
> (2) sorting order is passed as a bind parameter:
> $sort = 'asc';
> $sth = $dbh->prepare("select student_name from students order by first_name
> ?");
> $sth->execute($sort);
Hey, this is Perl! You can always do:
$sort = 'asc';
$sth = $dbh->prepare("select student_name from students order by
first_name $sort");
$sth->execute();
--
Bart.