Skip to main content

How to extract vtiger DB data



Here is the code sample how extract data form vtiger DB with WHERE close.
Sample:1
  

require_once('include/DatabaseUtil.php');

global $adb;

$tabid = array('9','16');

$sql = "SELECT tabid, fieldname, fieldid, fieldlabel,columnname, tablename, uitype,
typeofdata, presence FROM vtiger_field WHERE tabid in
(" . generateQuestionMarks($tabid) . ")";

$result = $adb->pquery($sql, array($tabid)); // get result
$noofrows = $adb->num_rows($result); // get number of rows

$i=0;
$data=array();
while($resultrow = $adb->fetch_array($result)) {
$tabid=$resultrow['tabid'];
$resultrow=['fieldlabel'];
$data[$i]=array($tabid, $resultrow);
}



Sample:2



require_once('include/DatabaseUtil.php');

global $adb;
$query = 'select idlists,from_email,to_email,cc_email,bcc_email from
vtiger_emaildetails where emailid =?';

$result = $adb->pquery($query, array($focus->id));
$from_email = $adb->query_result($result,0,'from_email');

Comments

Popular posts from this blog

How to add a new column to vtiger existing table

When we add a new column to existing vtiger table, we need do more than just adding a column to selected vtiger table. If you do so, you may unable to do some DB operation like insert update and deleted. This is the way how we can do this. 1. Add a new column to selected table as normal 2. Add a new row to "vtiger_field" table as fallow "insert into vtiger_field values (tabid, fieldid, columnname, tablename, generatedtype, uitype, fieldname, fieldlabel, readonly, presence, selected,maximumlength, sequence, block, displaytype, typeofdata, quickcreate,quickcreatesequence, info_type)" When you set a value to "presence" field be make sure to select 0 or 2. Otherwise your selected field not populated with vtiger field list.

Ananda

Current Software Engineer at LM Jinasena and Company (PVT) LTD Past Software Engineer at Archmage (PVT) LTD Trainee software Engineer at Respere ( Sahana Company ) Education Faculty of Information technology, University of Moratuwa ( http://www.mrt.ac.lk/ )- 2005/2006 batch Dammissara National school Naththandia (2004-Maths section) Websites My Blog Facebook Ananda’s Summary I am a graduate of Faculty of Information technology University Of Moratuwa and keen on web development field and specialized on IT management. Ananda’s Specialties: Technology: Pervasive computing, mobile backend solutions, mobile solutions, GIS, neo-geography, Location based services, Web 2.0, Social web,FOSS, Disaster Management Solutions Organizational: Strategic Planning, Project Management, Business Development, New Product strategy Ananda’s Experience Software Engineer, LM Jinasena and Company (PVT) LTD L M Jinasena and Company (PVT) LTD Aug 2010 — Present Software Engineer, Archmage (PVT) LTD Archmage (...