how can I do?

Events happening in the community are now at Drupal community events on www.drupal.org.
Praveen Dhyani's picture

I have a code for fetching and where I use it in Drupal and How?

I have made a Code is this right
Where and In Which file I use this code

<?php
$con = mysql_connect("localhost", "user", "user123!");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

$db_selected = mysql_select_db("drupalweb", $con);

if (!$db_selected)
{
die ("Can\'t use test_db : " . mysql_error());
}
$query = db_select('test1_drupal');
$query->fields('test1_drupal', array('rollno', 'name','result'));
$query->condition('regno', $regno);
$result1 = $query->execute()->fetch();

drupal_set_message($result1->rollno);
Read more
Subscribe with RSS Syndicate content