From: kasi ramanathen <[EMAIL PROTECTED]>
> i'm to update a pearl programme using mysql, i know only less of the
> latter. i come across a statement 
> 
> $ver=$dbh->prepare(SELECT jobid, pid from jobs where exectime<?');
> 
> now i want to know the perpose of "<?' " these charecters in the above
> statement

The < is just a less than. Nothing special about it. The ? is a so-
called placeholder. It means "the parameter will be inserted here".

This allows you to do:

        $ver=$dbh->prepare('SELECT jobid, pid from jobs where exectime < 
?');
        ...
        $RS = $ver->execute('2003-1-13');

and it will execute the
        SELECT jobid, pid from jobs where exectime < '2003-1-13'
statement and return the rows.

You should use ->prepare() and ->execute() if you plan to use the 
same statement many times and all you need is to change a few 
parameters.
This will allow the SQL server to "compile" the statement and prepare 
the "execution plan" just once and then reuse it.

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to