[mapserver-users] php-dbase replace error

Stepan Kafka stepan.kafka at centrum.cz
Tue Apr 9 02:25:46 EDT 2002


It is known error in the php-dbase modul. You have two possibilities:

1. patch the current dbase.c code according to attached document and
recompile php.
2. use newer version of PHP where this error has been already fixed (PHP >=
4.1.)


Stepan Kafka

> -----Pùvodní zpráva-----
> Od: owner-mapserver-users at lists.gis.umn.edu
> [mailto:owner-mapserver-users at lists.gis.umn.edu]za uživatele Shaik Anwar
> Hussain
> Odesláno: 8. dubna 2002 21:03
> Komu: Mapserver-Users (E-mail)
> Kopie: Ben Lewis
> Pøedmìt: [mapserver-users] php-dbase replace error
>
>
> Hello List,
>
>             I am trying to replace the dbase records using php_mapscript.
> Here is my php code. Its rewriting the records with null values. i want to
> replace with different values. does any one can help me whats wrong in my
> code.
>
>  Where photo is my shapefile name, it has 4 fields. i am using php4.06,
> mapserver3.5, apache,windows 2000.
>
> <?php
>
> 	dl('php_mapscript.dll');
> 	dl("php_dbase.dll");
> 	dl("php_proj.dll");
>
>
>    function delete_photo($shpfname, $pamcode)
>     {
>         $shapef = ms_newShapefileObj($shpfname,-2);
> 		$dbfile = dbase_open($shpfname, 2);
>
> 		$numrec = dbase_numrecords($dbfile);
> 		$nf = dbase_numfields($dbfile);
>
> 	     echo $numrec,"  ",$nf,$pamcode,"<BR>";
>
> 		$pamscode = "1";
>
> 	    for($k=0; $k<$numrec; $k++)
> 		{
> 		   $rec = dbase_get_record($dbfile,$k);
>
> 	       //echo $rec[0],$rec[1],$rec[2],$rec[3],"<BR>";
>
> 		   if (strtoupper(trim($rec[2])) == strtoupper($pamcode) )
> 		   {
> 			   $f1 = $rec[0];
> 			   $f2 = $rec[1];
> 			   $f3 = $rec[3];
> 		       //echo $f1,$f2,"<br>",$rec[0].$rec[1].$rec[2]."<br>";
> 		    dbase_replace_record($dbfile,
> array($f1,$f2,$pamscode,$f3),$k);
> 	       }
>
> 	     }
>
> 	     $shapef->free();
>          dbase_close($dbfile);
>
>        }  // End of the function photo delete
>
>
>
> # Begining of main program
>
>
>
>     $shpfname1 = "E:/Program Files/Apache
> Group/Apache/htdocs/php406/data/photo";
>     $num='170A';
>
>     delete_photo($shpfname1,$num);
>
>     exit;
> ?>
>
>
> Thanks,
> Anwar
> www.atsincorp.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020409/8c28f06f/PHPBugsBugReporting.htm


More information about the mapserver-users mailing list