php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3447 error on dbase_open function, it isn't open on write only or read-write mode.
Submitted: 2000-02-10 11:49 UTC Modified: 2001-02-10 15:58 UTC
From: padilha at totaldigital dot com dot br Assigned:
Status: Closed Package: dBase related
PHP Version: 3.0.12 OS: Linux
Private report: No CVE-ID: None
 [2000-02-10 11:49 UTC] padilha at totaldigital dot com dot br
The path is URL/DB and it have drwxrwxrwx attributes and the database pedido.DBF have rw-rw-rw attributes. I try to open it on write only  mode or read-write mode, but it is unabled to open. Then, I test the read only mode and it's enabled to open.
Then What's the error?

The Source Code that I used:
<?php
...
    if($include == "ped") 
                  { 
                  $resped1 = mysql_db_query("softtotal","select * from pedido where numpedido = $numorca"); 
                  $rest = mysql_num_rows($resped1); 
                  if($rest > 0) 
                    { 
                    echo("O pedido n?mero&nbsp;"); 
                    echo $numorca; 
                    echo("&nbsp; j? existe."); 
                    $option = " " ; 
                    } 
                  else 
                    { 
                    $resped = mysql_db_query("softtotal","select * from orcamento_geral where numero=$numorca"); 
                    $ped    = mysql_fetch_array($resped); 
                    $num     = $ped["numero"]; 
                    $cliente = $ped["cliente"]; 
                    $data    = $ped["data"]; 
                  $total   = $ped["total"]; 
                    if(($resinsped = mysql_db_query("softtotal","insert into pedido (numpedido,cliente,data,total_geral) values ($num,\"$cliente\",\"$data\",$total)")) == false) 
                      { 
                      echo("Erro ao incluir o pedido... Verifique se n?o faltam dados..."); 
                      } 
                    else 
                      { 
                      $include = "ped_item"; 
                      $dbopen = dbase_open("DB/pedido.DBF",1); 
                      $resmysql = mysql_db_query("softtotal","select * from orcamento_geral where numero=$numorca"); 
                      if(($rowped = mysql_fetch_array($resmysql)) > 0) 
                        { 
                        $pedido =
                array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60); 
                        $pedido[0] = $rowped["numero"]; 
                        $pedido[3] = $rowped["data"]; 
                        $pedido[6] = $rowped["codcli"]; 
                        $pedido[8] = $rowped["vendedor"]; 
                        $pedido[16]= $rowped["total"]; 
                   $numitem   = 1; 
                        $resorca   = mysql_db_query("db","select * from orcamento_item where num_orca=$numorca"); 
                        while($rowitem = mysql_fetch_array($resorca)) 
                          { 
                          $coditem  = $rowitem["cod_item"]; 
                          $formato1 = $rowitem["formato1"]; 
                          $formato2 = $rowitem["formato2"]; 
                          $recorte  = $rowitem["recorte"]; 
                          $resol    = $rowitem["resol"]; 
  $reslista = mysql_db_query("softtotal","select cores,servico from lista_preco where vodigo=$coditem"); 
                          $rowlista = mysql_ftech_array($reslista); 
                          $servico  = $rowlista["servico"]; 
                          if(($coditem > 2100) && ($coditem < 2200)) 
                            { 
                            $cores = $rowitem["cores"]; 
                            } 

                        else 
                            { 
                            $cores = $rowlista["cores"]; 
                            } 
                          $marca   = $servico; 
                          if($coditem > 1300) 
                            { 
                            if($recorte != "") 
                              { 
                              $especie = "Cores:"+$cores+","+$formato1+"X"+$formato2+","+"C/ Recorte"; 
                              } 
                            else 
                              { 
                              $especie = "Cores:"+$cores+","+$formato1+"X"+$formato2; 
                              } 
                            } 
                          if($coditem == 1300) 
                            $especie = "Tempo Mani.:"+$recorte; 
                          if(($coditem > 2100) && ($coditem < 2200)) 
                            $especie = "Cores:"+$cores+","+$formato1+"X"+$formato2+",Resol.:"+$resol; 
                          if(($coditem > 2200) && ($coditem < 3000)) 
                                 $especie = "Tempo Mani.:"+$recorte; 
                          if(($coditem > 2100) && ($coditem < 2200)) 
                            $especie = "Cores:"+$cores+","+$formato1+"X"+$formato2+",Resol.:"+$resol; 
                          if(($coditem > 2200) && ($coditem < 3000)) 
                            $especie = "Cores:"+$cores+","+$formato1+"X"+$formato2; 
                          if(($coditem > 3000) && ($coditem < 6000)) 
                            $especie = "Cores:"+$cores+","+$formato1+"X"+$formato2; 

                          $pedido[19] = $marca; 
                          $pedido[21] = $row["quant"]; 
                          $pedido[22] = $especie; 
                          $pedido[28] = $numitem; 
                          $numitem++; 
                          dbase_add_record($dbopen,$pedido); 
                          } 
                        } 
                      dbase_close($dbopen); 
                      } 
                    } 

                  } 
                                    
  ...
?>

Padilha                              

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-10 15:58 UTC] jimw@php.net
duplicate of 3429.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 19:01:30 2024 UTC