如果我有一個名爲書表什麼是在Drupal選擇查詢的正確語法
Column 1 = current_user
, Column 2 = page_length
, Column 3 = author
, Column 4 = title
我想選擇對應於當前登錄的3列2和4的數據用戶。以下正確的語法?
<?
global $user;
$user_id=$user->name;
db_query('SELECT * FROM {book} WHERE current_user=$user_id', $page_length, $author, $title); ?>
首先,您必須QUOT查詢。但是你想選擇什麼? –