in reply to Re^2: Explain SQL statement
in thread Explain SQL statement

Howdy!

It returns the same set of results once for each key in %expal. You pass a value to execute, but there are no placeholders in the query to receive the value.

If you change AND NUMALL IN (".join(',',keys %pal).") to AND NUMALL = ?, the select will return only the rows where NUMALL is that value in each pass.

yours,
Michael

Replies are listed 'Best First'.
Re^4: Explain SQL statement
by Anonymous Monk on May 26, 2004 at 14:06 UTC
    Tried and ruturned nothing
    $sql ="SELECT * FROM app_admin WHERE day = '$d' AND month = '$m_num' A +ND year = '$y' AND NUMALL ='?' AND status= '2' ";
    Tks...
      Howdy!

      You quoted the question mark. Don't do that. Read my previous note carefully.

      The naked ? gets replaced by the value you pass to the execute command, and DBI makes sure it is properly quoted.

      You want NUMALL = ?, not NUMALL = '?'.

      yours,
      Michael
        Tried that to, this is a wierd problem....
Re^4: Explain SQL statement
by Anonymous Monk on May 26, 2004 at 14:29 UTC
    Whould guess why the code is returning nothing?