Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-10-2005, 05:38 PM   #1 (permalink)
Wysocki
Recruit
 
Join Date: Jan 2005
Location: Covina, CA
Posts: 22
Wysocki is on a distinguished road
dBase functions in PC based PHP?

I installed PHP (from php-4.3.10-installer.exe) on my Windows 2000 workstation and I'm writing some scripts now. I discovered that there are dBase functions and tried to use a couple of them, but got a "Call to undefined function" error message. The PHP docs say "...to use these functions, you must compile PHP with the --enable-dbase option". What about the PC based version that I installed? Is there any way to get the dbase functions in it?

[EDIT:] Nevermind! I found the answer myself
I got the Windows Zip file, copied the dbase extension dll to my php installation, created an ini file, and it works! Yay!

Last edited by Wysocki; 02-10-2005 at 06:58 PM.
Wysocki is offline   Reply With Quote
Old 02-11-2005, 11:49 AM   #2 (permalink)
Wysocki
Recruit
 
Join Date: Jan 2005
Location: Covina, CA
Posts: 22
Wysocki is on a distinguished road
Well, things WERE going good but now I have a problem with dbase add and replace commands. Thought I'd just add it to this thread since the subject seemed appropriate but maybe this is a bit beyond a "Newbie" forum (even though that's what I am ). Here's what I have:
Code:
$dbfile = "s:\\PISSK\\DATA\\TEST.DBF";
$db = dbase_open($dbfile, 2)
  or die("Error! Could not open dbase database file '$dbfile'.");
$row = dbase_get_record_with_names($db, 1);
unset($row['deleted']);
dbase_replace_record($db, $row, 1);
dbase_add_record($db, $row);
dbase_close($db);
print_r($row);
And here's what I get back:
Code:
C:\PHP>php x:test.php
Content-type: text/html
X-Powered-By: PHP/4.3.10

<br />
<b>Warning</b>:  unexpected error in <b>x:\test.php</b> on line <b>8</b><br />
<br />
<b>Warning</b>:  unexpected error in <b>x:\test.php</b> on line <b>9</b><br />
Array
(
    [FIELDA] => aaaaa
    [FIELDB] => 1
    [FIELDC] => AAAAA
)
The dbf file has three fields in it (char10,num10,char10) and a few records. I can't get the REPLACE to work nor the ADD (which I tried just to see if it worked). Anyone know how to debug what the "unexpected error" is?
Wysocki is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing a server script from PHP sde PHP 4 02-05-2005 11:12 AM
PHP to Flash control panel roccoman PHP 1 11-24-2004 08:10 AM
PHP vs .NET Redline Lounge 1 11-24-2004 06:10 AM
PHP Comes of Age sde Code Newbie News 0 04-14-2004 11:41 AM
I need to learn PHP Nitro PHP 9 06-28-2003 11:24 AM


All times are GMT -8. The time now is 10:34 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting