I have a menu item like this:
$items['property/edit/%'] = array(
'page callback' => 'drupal_get_form',
'page arguments' => array('property_edit_view',2),
'access arguments' => array('access property edit page'),
'type' => MENU_CALLBACK,
);
now I want to get the id next to edit, '%'? and here is the function which process it.
function property_edit_view($id){
drupal_set_title("Edit the Property");
global $user;
$form = array();
dpm($id);
$sql = "SELECT * FROM {property} WHERE property_id= $id AND property_uid = $user->uid";
$result = db_query($sql);
$row = db_fetch_object($result);
$form['p_name'] = array(
'#type' => 'textfield',
'#title'=>t('Name of the Property'),
'#required'=>TRUE,
'#default_value'=>t($row->property_name),
);
return $form;
}
but i am getting an error now:
user warning: Unknown column 'Array' in 'where clause' query: SELECT * FROM property WHERE property_id= Array AND property_uid = 1 in C:\wamp\www\getting-in.com\sites\all\modules\property\property.module on line 284.
Is there any way to sort it out please?