如果我有一个名为book的表
Column 1 = current_user
, Column 2 = page_length
, Column 3 = author
, Column 4 = title
我想从第2,3和4列中选择与当前登录用户相对应的数据。语法是否正确?
<?
global $user;
$user_id=$user->name;
db_query('SELECT * FROM {book} WHERE current_user=$user_id', $page_length, $author, $title); ?>