fetchRow error

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

Post Reply
davidjwest
Forum Commoner
Posts: 67
Joined: Sat Nov 06, 2004 5:26 am
Location: Leeds, Yorkshire, England

fetchRow error

Post by davidjwest »

I've just started getting an error regarding an undefined function fetchRow, but I have included db.php which I believe defines this function.

Is it me who is wrong or is there some kind of hosting problem meaning when I include the db.php it isn't finding it?

The code worked fine yesterday and I've not made any changes to it.

Any ideas? I can post more info if needs be.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

post the code. (remember [syntax=php]tags)[/syntax]
davidjwest
Forum Commoner
Posts: 67
Joined: Sat Nov 06, 2004 5:26 am
Location: Leeds, Yorkshire, England

Post by davidjwest »

I'm pretty sure the problem is due to a missing db.php file, which I don't ever remember installing or deleting, I thought my host provided this somewhow.

Anyway, does anyone know if I can simply download and install this file and is it simply a case of putting it into the same dir as my other includes files?

Anyone know where I can get the file?

If this doesn't work I'll post the code, but there is quite a lot of it.

My host has repsonded to my request for tech support yet.
davidjwest
Forum Commoner
Posts: 67
Joined: Sat Nov 06, 2004 5:26 am
Location: Leeds, Yorkshire, England

Post by davidjwest »

I installed db.php and now I get a different error:
Fatal error: Call to undefined function: assertextension() in /usr/lib/php/DB/mysql.php on line 114
I can't even find this file as I don't have directories called usr/lib/php or even DB, where is it?

I've discovered there is a problems with the assertexternsion function

http://pear.php.net/bugs/bug.php?id=1337
marike
Forum Newbie
Posts: 24
Joined: Thu Mar 31, 2005 6:19 pm
Location: New York

Fetchrow problem

Post by marike »

It sounds like you dont' have PEAR correctly set up on your computer.
You cannot just, i.e.through DB.php in a directory in your include_path and hope it works, as DB.php has other classes that it depends on like PEAR.php.

You need have whole PEAR DB package with is a generic database wrapper. The entire PEAR directory should be in your include_path and on Linux, and Mac OS X it is usually something like /usr/local/lib/php or /usr/lib/php.

The PEAR extensions are fantastic, not only for interacting with MySQL, but for things like parsing XML files, screen scraping, working with HTML forms with HTML/Quickforms. I wish you luck in getting it working.

On Linux download PEAR as root at the shell prompt:
lynx -source go-pear.org | php

On Mac OS X at Terminal type:
curl go.pear.org | sudo php

And on Windows, visit http://go-pear.org in a web browser and save the contents of that page as C:\PHP\go-pear.org (assuming you've installed PHP in C:\PHP). Then pass that file to the php.exe program.

From the command prompt type:
C:
CD \PHP
PHP go-pear.org

I'm a big fan of PEAR and use it alot. Supposedly it is slower than native PHP mysql functions but it seem like most classes, and wrappers are a bit slower than proceedural scripts, but I could be wrong.

Anyway, hope this helps.







Post Reply