PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
bouncer
Forum Contributor
Posts: 162 Joined: Wed Feb 28, 2007 10:31 am
Post
by bouncer » Fri Mar 09, 2007 12:45 pm
what is wrong with this code ?
i cant open the file, dont know why, can someone help me ?
Code: Select all
$db = @dbase_open('Exist.dbf', 0);
if ($db) {
$record_numbers = dbase_numrecords($db);
for ($i = 1; $i <= $record_numbers; $i++) {
echo $record_numbers[$i];
}
}
thanks in advance
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Mar 09, 2007 12:48 pm
remove the @ and let the script start with
Code: Select all
error_reporting(E_ALL);
ini_set('display_errors', true);
bouncer
Forum Contributor
Posts: 162 Joined: Wed Feb 28, 2007 10:31 am
Post
by bouncer » Fri Mar 09, 2007 12:53 pm
if i remove @ appeas this:
" Fatal error: Call to undefined function dbase_open() "
thanks in advance
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Mar 09, 2007 12:57 pm
You need the dbase extension. How you get, install and load it depends on the webserver's os.
bouncer
Forum Contributor
Posts: 162 Joined: Wed Feb 28, 2007 10:31 am
Post
by bouncer » Fri Mar 09, 2007 12:58 pm
are you talking about the dbase.dll ???
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Mar 09, 2007 12:59 pm
If it's a win32 server then I'm talking about php_dbase.dll
bouncer
Forum Contributor
Posts: 162 Joined: Wed Feb 28, 2007 10:31 am
Post
by bouncer » Fri Mar 09, 2007 1:02 pm
yes is a win32, and i already have that dll
bouncer
Forum Contributor
Posts: 162 Joined: Wed Feb 28, 2007 10:31 am
Post
by bouncer » Fri Mar 09, 2007 1:09 pm
i have already done that....and nothing
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Mar 09, 2007 1:10 pm
You did it wrontg. Check again.
bouncer
Forum Contributor
Posts: 162 Joined: Wed Feb 28, 2007 10:31 am
Post
by bouncer » Fri Mar 09, 2007 1:16 pm
it's everything fine...dont understand...in php.ini-dist and php.ini-recommended files i have uncomment extension=php_dbase.dll
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Mar 09, 2007 1:19 pm
call <?php phpinfo(); ?> and see which php.ini is used. This file you have to edit. Don't forget to restart the webserver (software) when you're done.
bouncer
Forum Contributor
Posts: 162 Joined: Wed Feb 28, 2007 10:31 am
Post
by bouncer » Fri Mar 09, 2007 1:24 pm
ok, i'll go check that
thanks in advance