line 8

$qry = db_query('SELECT path, location FROM {filebrowser} WHERE 1');

should be rather

$qry = db_query("SELECT path, location FROM {filebrowser} WHERE 1=1");

(i don't understand this where condition)
line 25

  $listing = db_fetch_object(db_query('SELECT location, can_explore FROM {filebrowser} WHERE path = "%s"', $path));

should be rather

$listing = db_fetch_object(db_query("SELECT location, can_explore FROM {filebrowser} WHERE path = '%s'", $path));

" <- this is reserved for table names in postgresql

Comments

Susurrus’s picture

The where condition in the first query can just be removed. You rarely see where-less queries in the wild, so I normally put them in just for convention, though they can be removed I think in most DBs.

As far as the quotes, I like to have single quotes in PHP to reduce string parsing w/ variable replacement to "speed things up"; it's also prettier in Eclipse. Is single-quotes the only string encapsulation pgsql supports or would ` work?

Susurrus’s picture

Status: Active » Fixed

Fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.