Form api submit and update database problem.

I'm getting an error and this is really the first time I've tried to actively interact with the database from a module. Just hoping that someone can spot the problem and help me correct it. Basically it takes a date value from the form (Date module is used to get the date formatting). I want it to save into a table with three fields

wedid/primary/auto incremental
uid/ user uid
field_weddingdate / the date entered into the form + 3 months (90days)

Schema works as expected. The form works as expected but I need to change the default value to read from the database and not use variable_set. The form_submit gives the following error.

error : Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given,

Currently I have the following code for hook_schema , hook_form , hook_form_submit


<?php
/*
* Schema
*/
function weddingdate_schema(){
$schema['wedding'] = array(
'description' => 'For storing information related to wedding',
'fields' => array(
'wedid' => array(
'description' => 'Wedding table id',
'type' => 'serial',
'not null' => TRUE,
),
'uid' => array(
'description' => 'Copy of user id our link to the user',
'type' => 'int',
'not null' => FALSE,
),
'field_weddingdate' => array(
'description' => 'The calculated Wedding Date',

all purpose theme

Hi everyone,

Is there a module with help of that I can add code with syntax highlight in a box or something like that?

Hi Everyone

I am new to Drupal, I am wondering if there is any module with the help of I can add code snippet in between my content in a separate box or border with code highlight depending on the language I select like java, c++, actionscript, php basically any language.
I have seen things like that on some sites but I am not sure those were in Drupal or something else.

Thanks,
Saket

Search Feature?

In Drupal 7, can user use the search feature to search for subject lines in the forums? Example, someone created a Hello in the subject line and someone else were to search Hello, will it show up?

Fivestar voting module error , please help !!

Hey guys , i am new to Drupal , and i added some contents and installed the following Module called FiveStar,

http://drupal.org/project/fivestar

it rates your comments , atleast thats what i want.

But unfortunately , i get the following error , when i open my comments.

* Warning: Missing argument 2 for fivestar_comment_load() in fivestar_comment_load() (line 201 of I:\xampp\htdocs\sites\all\modules\fivestar\fivestar_comment.module).
* Warning: Illegal offset type in isset or empty in fivestar_comment_load() (line 204 of I:\xampp\htdocs\sites\all\modules\fivestar\fivestar_comment.module).
* Recoverable fatal error: Object of class stdClass could not be converted to string in DatabaseStatementBase->execute() (line 2039 of I:\xampp\htdocs\includes\database\database.inc).

These are the lines in the fivestar_comment.module which include line 201 and 204.

/**
* Get a current rating(s) for a comment.
*/
function fivestar_comment_load($cid, $nid, $reset = FALSE) {
global $user;
static $cids = array();
if (!isset($cids[$cid]) || $reset) {
$result = db_query('SELECT * FROM {fivestar_comment} WHERE cid = %d', $cid);

while($data = db_fetch_array($result)) {
$cids[$cid][$data['tag']] = $data;
}
}
return $cids[$cid];
}

This is 2039 line in database.inc

$return = parent::execute($args);

Available Updates

When I'm in the admin panel and I'm in available updates and I choose download these updates now, where do they go and how can I install them from there?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x