Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2007
    Posts
    23

    Unanswered: Warning: sybase_fetch_array() - bug???

    Hi all

    some can helpme with this ??

    have a query like that

    $tiempo = 'declare
    @ultimo datetime
    set nocount on
    select @ultimo = Fecha_Automatica from admsamu.Controloptimo_Evento
    where
    Fecha_Automatica=(select max(Fecha_Automatica) from admsamu.Controloptimo_Evento)
    select "diferencia" = datediff(minute, @ultimo, getdate())
    set nocount off';
    $no_grava = sybase_query($tiempo);
    while ($row=sybase_fetch_array($no_grava))
    {
    $minutos = $row["diferencia"];
    };
    that must find the most recent input, compare with getdate() and returns a difference in minutes betwen that 2 datetime type, generaly 0 or 1 (minutes)... lower numbers and just 1 row...

    in WAMP run fine, but put it in LAMP and fails with this error :

    Warning: sybase_fetch_array(): 1 is not a Sybase result index in control_cronas.php on line 87
    someone explyme waths wrong please ???... help...

    thnx in advance... and sorry my english... again
    There's only 10 kinds of people: the ones who know binary and the ones who doesn't

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if it works OK in Windows and not in Linux then I'd want to check why
    two suspects come to mind
    EITHER
    the function isn't supported in the Linux version of the Sybase server you are running
    OR
    its to do with capitalisation.. the windows world generally doesn't give a stuff about capitalisation, but in the Linux World it matters....

  3. #3
    Join Date
    Dec 2007
    Posts
    23
    the warning message is just in this line

    while ($row=sybase_fetch_array($no_grava))
    at least that say the browser...

    can i obtain the single result from another way ???

    the select is right, but the array don't work...

    just need to abotain the diference, in minutes, betwen two datetime type... and it generaly is few minutes or cero.

    some can hepl... plz

    grtgs
    There's only 10 kinds of people: the ones who know binary and the ones who doesn't

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    have you checked the SQL in a sysbase client, to make certain the SQL is valid

  5. #5
    Join Date
    Dec 2007
    Posts
    23
    Quote Originally Posted by healdem
    have you checked the SQL in a sysbase client, to make certain the SQL is valid
    yes... first probe directly in Sybase...
    the final result is obtain by :

    select "diferencia" = datediff(minute, @ultimo, getdate())
    if you replace @ultimo with getdate() that returns "0", and it's right, generaly the query must return "0" or "1", the result is higher when have a truble... but when try to read this single from the array send me error, but just in LAMP, that work fine in WAMP... no error in windows... (that is too far from reality XD )

    grtgs
    There's only 10 kinds of people: the ones who know binary and the ones who doesn't

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •