Announcement

Collapse
No announcement yet.

sc_lookup macro "ID" instead number

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • sc_lookup macro "ID" instead number

    $check_sql = "SELECT field01, field02, field03, field04, ... from sometable;";
    sc_lookup(rs, $check_sql);

    How can i get the value of "field02" by acessing it by its index name?
    Code:
     $field02 = {rs[0]["field02"]};
    instead of this?
    Code:
    $field02 = {rs[0][1]};
    Like in this php exemple

    Code:
    http://www.w3schools.com/php/php_mysql_select.asp
    
    while($row = $result->fetch_assoc()) {
            echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
        }

  • #2
    Using sc_select instead sc_lookup. Sc_lookup returns an array (not associative) while sc_select returns an ADOrecordset

    {rs}->Field('field02')

    Speaking from memory
    /Giuseppe

    Professional Scriptcase Services
    Some Customers opinions

    Comment


    • #3
      I will try, thanks Giu.

      Best Regards,
      Vítor Pereira

      Comment


      • #4
        Originally posted by Giu View Post
        Using sc_select instead sc_lookup. Sc_lookup returns an array (not associative) while sc_select returns an ADOrecordset

        {rs}->Field('field02')

        Speaking from memory
        Thanks for the help, its {rs}->fields('field02')

        from http://www.scriptcase.com.br/docs/pt...case#sc_select

        Code:
        sc_select(meus_dados, "select clienteid, nomecliente, limitecred from clientes");
        if ({meus_dados} === false)
        {
        echo "Erro de acesso. Mensagem = " . {meus_dados_erro};
        }
        else
        {
        while (!$meus_dados->EOF){
        {nome_cliente} = $meus_dados->fields['clienteid'];
        $meus_dados->MoveNext();
        }
        $meus_dados->Close();
        }

        Comment

        Working...
        X