I have a code for fetching and where I use it in Drupal and How?
Posted by Praveen Dhyani on December 5, 2011 at 6:43am
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