Re: mysql query statement

2002-06-09 Thread Janek Schleicher
Hytham Shehab wrote at Fri, 08 Jun 2001 15:10:19 +0200: > hi all of u, > 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"); >

Re: mysql query statement

2002-06-08 Thread fliptop
Hytham Shehab wrote: > i did it already flip, but its not yet valid, also it seems to be mentaly > valid, its not for mysql. perhaps you should ask your question on a more appropriate list. try this one: http://lists.perl.org/showlist.cgi?name=dbi-users -- To unsubscribe, e-mail: [EMAIL P

Re: mysql query statement

2002-06-08 Thread Hytham Shehab
fliptop said: > you're trying to substitute the value twice. try something like this > instead: > > $sort = 'first_name asc'; > $sth = $dbh->prepare("select foo from bar order by ?") > $sth->execute($sort); i did it already flip, but its not yet valid, also it seems to be mentaly valid, its not

Re: mysql query statement

2002-06-08 Thread fliptop
Hytham Shehab wrote: > (2) sorting order is passed as a bind parameter: > $sort = 'asc'; > $sth = $dbh->prepare("select student_name from students order by first_name > $sort"); > $sth->execute($sort); you're trying to substitute the value twice. try something like this instead: $sort = 'fir

mysql query statement

2002-06-08 Thread Hytham Shehab
hi all of u, 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: $so

Re: mysql query statement

2002-06-06 Thread fliptop
Hytham Shehab wrote: > hi all of u, > all whatta i want is see the exact executed query b4 its execution, i > mean not like this "select blah from blah when x=? but not ? order by ?", i > want to see as if u write it in the console of mysql, something like that > "select blah from blah w

mysql query statement

2002-06-06 Thread Hytham Shehab
hi all of u, all whatta i want is see the exact executed query b4 its execution, i mean not like this "select blah from blah when x=? but not ? order by ?", i want to see as if u write it in the console of mysql, something like that "select blah from blah where x=10 order by 'big' group b

mysql query statement

2002-06-06 Thread Hytham Shehab
hi all of u, all whatta i want is see the exact executed query b4 its execution, i mean not like this "select blah from blah when x=? but not ? order by ?", i want to see as if u write it in the console of mysql, something like that "select blah from blah where x=10 order by 'big' group by 'zi