PostgreSQL does not like `...`

AlexisWilke - April 22, 2009 - 17:43
Project:Webmail Plus
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

Hi there,

The correct way to use keywords or fields with spaces under PostgreSQL is to use double quotes (") which I think do work with MySQL. However, to be forward compatible, I suggest you simply don't use those at all.

The following breaks with PostgreSQL:

<?php
 
...
 
$results = db_query("SELECT `folder` FROM {webmail_plus_user_folders} WHERE uid=%d", $user->uid);
  ...
?>

 
 

Drupal is a registered trademark of Dries Buytaert.