Hello,

Iam using drupal 6.11.

My problem :
I created one separate table. Then i want to insert data in that table by using xxx.php file.
The insert query presented in the xxx.php file.
I Called that file using ajax from page.tpl.php file...

here the file called SUCCESSFULLY, but it returned the error named as "Fatal error: Call to undefined function db_query()"..

This is the query presented in that file....

$query="insert into page_ajax set sname='$name'";
db_query($query);

if($result)
{
echo 'Connected successfully';
}
else
{
echo 'Not Connected SuccessFully';
}

But it returns the above error..

The mysql_query() itself not worked...how to insert the data...

or

tell me how i can used the db_query() in that file...

Kindly solve give me a solution...

Regards
Mani

Comments

nevets’s picture

One approach would be to make a module that implements hook_menu() that defines a path (to be used by ajax code) that defines a callback function that saves the data.

mani8php’s picture

Thanks for your kind reply...