PDA

View Full Version : Deadful Question


radhi
01-12-2005, 04:37 AM
Hi everyone,
I am trying the new tech AMFPHP for the first time in my project,the project is basically a CMS project .The problem i am facing is i am having a for loop inside the AMfphp class but it is not running till the specified limit and it is emiting only one value when retreiving in flash the code is as follows

AMFPHP:

<?php

class Test{

function Test() { /* constructor */
$this->methodTable = array(
'ProjectInfo' => array(
'description' => 'Retreives project informations from the database.',
'access' => 'remote',
'arguments' => array('')
)

);

if (!$link = mssql_connect('192.168.5.229', 'developer', 'developer'))
return mssql_error();
if (!mssql_select_db('CMS', $link)) return mssql_error();

}

function ProjectInfo() {


$queryres = "Select s.projectid,p.projecttitle,s.levelid,s.Level1ID,s. Level2ID,s.Level3ID,s.Level4ID,s.Level5ID,s.Level6 ID,s.Level7ID,s.Level8ID,s.Level9ID, s.description,convert(varchar,s.createdate,108) as TimeCreated from SystemAlerts s ,project p where s.projectid=p.projectid ORDER by s.levelid,s.Level1ID,s.Level2ID,s.Level3ID,s.Level 4ID,s.Level5ID,s.Level6ID,s.Level7ID,s.Level8ID,s. Level9ID";
//print "QUERY - $queryres<BR>";

$rs_queryres = mssql_query($queryres);
$nrows = mssql_num_rows($rs_queryres);
//return $nrows;---61

if ($nrows > 0)
{
$i=0;
$tempsys_jobid= 0;
$tempsys_levelid = -1;
$tmpsys_level1id = -1;
$tmpsys_level2id = -1;
$tmpsys_level3id = -1;
$tmpsys_level4id = -1;
$tmpsys_level5id = -1;
$tmpsys_level6id = -1;
$tmpsys_level7id = -1;
$tmpsys_level8id = -1;
$tmpsys_level9id = -1;

for($i=0 ; $i < $nrows ; $i++ )
{
$sys_Jobid = mssql_result($rs_queryres,$i,"projectid");
$sys_Jobtitle = mssql_result($rs_queryres,$i,"projecttitle");
$sys_levelid = mssql_result($rs_queryres,$i,"levelid");
$sys_level1id = mssql_result($rs_queryres,$i,"level1id");
$sys_level2id = mssql_result($rs_queryres,$i,"level2id");
$sys_level3id = mssql_result($rs_queryres,$i,"level3id");
$sys_level4id = mssql_result($rs_queryres,$i,"level4id");
$sys_level5id = mssql_result($rs_queryres,$i,"level5id");
$sys_level6id = mssql_result($rs_queryres,$i,"level6id");
$sys_level7id = mssql_result($rs_queryres,$i,"level7id");
$sys_level8id = mssql_result($rs_queryres,$i,"level8id");
$sys_level9id = mssql_result($rs_queryres,$i,"level9id");
$sys_TimeCreated= mssql_result($rs_queryres,$i,"TimeCreated");
$sys_Description = mssql_result($rs_queryres,$i,"description");


if ($sys_Jobid <> $tempsys_jobid)
{
/*if($i >0)
{*/
return $sys_Jobtitle;

//}
}
}

}
}
}
?>

The FLASH CODE:

#include "NetDebug.as"
#include "NetServices.as"

NetServices.setDefaultGatewayUrl("http://192.168.5.229/newscriptorium/Radhi/0.5.1ver/DashBoard/dash_gateway.php");
conn = NetServices.createGatewayConnection();
var servD = conn.getService("Test",this);

_root.show.text = "PROJECT INFO";
_root.show.backgroundColor = "0x3399CC";//"0x0066ff";
// _root.show.border = true;
_root.show.textColor = "0xFFFFFF";
_root.project.backgroundcolor="0xcccccc";

_root.project.textColor="0x000000";//"0x009933";
servD.ProjectInfo();
function ProjectInfo_Result(result_rs)
{
trace(result_rs);
}

What is the problem i am having and pls help me by giving suggestion in improving the code.

This is only a small part i have to generate a lot of data like this from athe db and show it in the flash.

pls help
Thanks a lot in advance.

radhi
01-12-2005, 08:46 AM
someone pls help me

petefs
01-13-2005, 12:51 PM
the moment the AMFPHP method returns a value it will cease to execute. instead, push all of the data into an array/object and return that value when everything's finished.

radhi
01-17-2005, 03:13 AM
First of all thanks to you for helping in correct time.

I already tried this method but in the netconnection debugger i am getting "NetConnection.call.BadVersion".I don't know where is the error happening in my code.pls help me.

Thanks in advance.

radhi
01-17-2005, 08:11 AM
Thanks i found out the solution.

I have one doubt.How can i access the value of an array created in one function from the other one in amfphp

Thanks in advance.

petefs
01-17-2005, 06:36 PM
class Test{
var $myArray = array();
function Test() { /* constructor */
$this->methodTable = array(
'ProjectInfo' => array(
'description' => 'Retreives project informations from the database.',
'access' => 'remote',
'arguments' => array('')
)

);

if (!$link = mssql_connect('192.168.5.229', 'developer', 'developer'))
return mssql_error();
if (!mssql_select_db('CMS', $link)) return mssql_error();

}

function ProjectInfo()
{
$this->myArray[] = "foo";
}
}

now you should be able to access myArray from anywhere in the class : )

radhi
01-18-2005, 04:16 AM
Thanks
But i want to access an array from one member function which is populated inside another member function.
And the above php code i attached is a very small bit of my code based on that code i have to write many for and if conditions .using these conditions i will get many results.How can i combine and get these results into one and return value.If i put them in an array and return it to flash it will one generate the last values.

Or i have to create seperate functions as follow .

Give me some suggestions regarding this.

CODE:
<?php

class Tested{

//var $val2 = array();
function Tested() { /* constructor */
//$this->$val2 = "hai";
$this->methodTable = array(
'ProjectInfo' => array(
'description' => 'Retreives project informations from the database.',
'access' => 'remote',
'arguments' => array('')
),
'ProjectInfo2' => array(
'description' => 'Retreives project information-2 from the database.',
'access' => 'remote',
'arguments' => array('')
),
'ProjectInfo3' => array(
'description' => 'Retreives project information-3 from the database.',
'access' => 'remote',
'arguments' => array('')
),
'ProjectInfo4' => array(
'description' => 'Retreives project information-4 from the database.',
'access' => 'remote',
'arguments' => array('')
)

);

if (!$link = mssql_connect('192.168.5.229', 'developer', 'developer'))
return mssql_error();
if (!mssql_select_db('CMS', $link)) return mssql_error();

}


function ProjectInfo()
{

$queryres = "Select s.projectid,p.projecttitle,s.levelid,s.Level1ID,s. Level2ID,s.Level3ID,s.Level4ID,s.Level5ID,s.Level6 ID,s.Level7ID,s.Level8ID,s.Level9ID, s.description,convert(varchar,s.createdate,108) as TimeCreated from SystemAlerts s ,project p where s.projectid=p.projectid ORDER by s.levelid,s.Level1ID,s.Level2ID,s.Level3ID,s.Level 4ID,s.Level5ID,s.Level6ID,s.Level7ID,s.Level8ID,s. Level9ID";
$rs_queryres = mssql_query($queryres);
$nrows = mssql_num_rows($rs_queryres);
//return $nrows;---61
// $array = array();
if ($nrows >0)
{
$i=0;
$tempsys_jobid= 0;
$tempsys_levelid = -1;
$tmpsys_level1id = -1;
$tmpsys_level2id = -1;
$tmpsys_level3id = -1;
$tmpsys_level4id = -1;
$tmpsys_level5id = -1;
$tmpsys_level6id = -1;
$tmpsys_level7id = -1;
$tmpsys_level8id = -1;
$tmpsys_level9id = -1;


$data = array();

for($i=0;$i<$nrows;$i++)
{

$sys_Jobid = mssql_result($rs_queryres,$i,"projectid");
$sys_Jobtitle = mssql_result($rs_queryres,$i,"projecttitle");
$sys_levelid = mssql_result($rs_queryres,$i,"levelid");
$sys_level1id = mssql_result($rs_queryres,$i,"level1id");
$sys_level2id = mssql_result($rs_queryres,$i,"level2id");
$sys_level3id = mssql_result($rs_queryres,$i,"level3id");
$sys_level4id = mssql_result($rs_queryres,$i,"level4id");
$sys_level5id = mssql_result($rs_queryres,$i,"level5id");
$sys_level6id = mssql_result($rs_queryres,$i,"level6id");
$sys_level7id = mssql_result($rs_queryres,$i,"level7id");
$sys_level8id = mssql_result($rs_queryres,$i,"level8id");
$sys_level9id = mssql_result($rs_queryres,$i,"level9id");
$sys_TimeCreated=mssql_result($rs_queryres,$i,"TimeCreated");
$sys_Description=mssql_result($rs_queryres,$i,"description");

if ($sys_Jobid <> $tempsys_jobid)
{
if($i>=0)
{

$data[$i]= "PROJECT NAME:".$sys_Jobtitle;

}
}

}
return $rs_queryres ;
}
}

function ProjectInfo2()
{

$queryres = "Select s.projectid,p.projecttitle,s.levelid,s.Level1ID,s. Level2ID,s.Level3ID,s.Level4ID,s.Level5ID,s.Level6 ID,s.Level7ID,s.Level8ID,s.Level9ID, s.description,convert(varchar,s.createdate,108) as TimeCreated from SystemAlerts s ,project p where s.projectid=p.projectid ORDER by s.levelid,s.Level1ID,s.Level2ID,s.Level3ID,s.Level 4ID,s.Level5ID,s.Level6ID,s.Level7ID,s.Level8ID,s. Level9ID";
$rs_queryres = mssql_query($queryres);
$nrows = mssql_num_rows($rs_queryres);
//return $nrows;---61
// $array = array();
if ($nrows >0)
{
$i=0;
$tempsys_jobid= 0;
$tempsys_levelid = -1;
$tmpsys_level1id = -1;
$tmpsys_level2id = -1;
$tmpsys_level3id = -1;
$tmpsys_level4id = -1;
$tmpsys_level5id = -1;
$tmpsys_level6id = -1;
$tmpsys_level7id = -1;
$tmpsys_level8id = -1;
$tmpsys_level9id = -1;


//$data = array();

for($i=0;$i<$nrows;$i++)
{

$sys_Jobid = mssql_result($rs_queryres,$i,"projectid");
$sys_Jobtitle = mssql_result($rs_queryres,$i,"projecttitle");
$sys_levelid = mssql_result($rs_queryres,$i,"levelid");
$sys_level1id = mssql_result($rs_queryres,$i,"level1id");
$sys_level2id = mssql_result($rs_queryres,$i,"level2id");
$sys_level3id = mssql_result($rs_queryres,$i,"level3id");
$sys_level4id = mssql_result($rs_queryres,$i,"level4id");
$sys_level5id = mssql_result($rs_queryres,$i,"level5id");
$sys_level6id = mssql_result($rs_queryres,$i,"level6id");
$sys_level7id = mssql_result($rs_queryres,$i,"level7id");
$sys_level8id = mssql_result($rs_queryres,$i,"level8id");
$sys_level9id = mssql_result($rs_queryres,$i,"level9id");
$sys_TimeCreated=mssql_result($rs_queryres,$i,"TimeCreated");
$sys_Description=mssql_result($rs_queryres,$i,"description");

if ($sys_Jobid <> $tempsys_jobid)
{
if($i>=0)
{

//$data[$i]= "PROJECT NAME:".$sys_Jobtitle;

}
}

$Queryfields = "select projectformfields1.fieldid as controlid,projectformfields1.label as controlname,projectformfields1.levelid
from projectformfields1
where
projectformfields1.projectid = '$sys_Jobid' and
projectformfields1.levelid = '$sys_levelid'
and displayflag=1
order by fieldid";

$rs_Fields = mssql_query($Queryfields);
$nrowfields = mssql_num_rows($rs_Fields);





$query = "select projectformdata.controlid,projectformdata.levelnam e,
projectformdata.controltype,projectformdata.fld_va rchar,projectformdata.fld_int,
convert(varchar,projectformdata.fld_date,101) as fld_date,projectformdata.fld_bool,
projectformdata.level1id,projectformdata.level2id, projectformdata.level3id,projectformdata.level4id,
projectformdata.level5id, projectformdata.level6id,projectformdata.level7id,
projectformdata.level8id,projectformdata.level9id
from projectformdata
where
projectformdata.projectid = '$sys_Jobid' and
projectformdata.levelid = '$sys_levelid' and
projectformdata.level1id = '$sys_level1id' and
projectformdata.level2id = '$sys_level2id' and
projectformdata.level3id = '$sys_level3id' and
projectformdata.level4id = '$sys_level4id' and
projectformdata.level5id = '$sys_level5id' and
projectformdata.level6id = '$sys_level6id' and
projectformdata.level7id = '$sys_level7id' and
projectformdata.level8id = '$sys_level8id' and
projectformdata.level9id = '$sys_level9id'
order by controlid";

$rs_projectformdata = mssql_query($query);
$nrowprojectformdata = mssql_num_rows($rs_projectformdata);


if($nrowprojectformdata > 0)
{
$formdata_curlevelname = mssql_result($rs_projectformdata,0,"levelname");
}
else
{
$formdata_curlevelname = "-Not Selected-";
}
if($sys_Jobid != $tempsys_jobid || $sys_levelid <> $tempsys_levelid)
{
$val = "FORM NAME :".$formdata_curlevelname;
}
}

return $val;

}

}


function ProjectInfo3()
{

$queryres = "Select s.projectid,p.projecttitle,s.levelid,s.Level1ID,s. Level2ID,s.Level3ID,s.Level4ID,s.Level5ID,s.Level6 ID,s.Level7ID,s.Level8ID,s.Level9ID, s.description,convert(varchar,s.createdate,108) as TimeCreated from SystemAlerts s ,project p where s.projectid=p.projectid ORDER by s.levelid,s.Level1ID,s.Level2ID,s.Level3ID,s.Level 4ID,s.Level5ID,s.Level6ID,s.Level7ID,s.Level8ID,s. Level9ID";
$rs_queryres = mssql_query($queryres);
$nrows = mssql_num_rows($rs_queryres);
//return $nrows;---61
// $array = array();
if ($nrows >0)
{
$i=0;
$tempsys_jobid= 0;
$tempsys_levelid = -1;
$tmpsys_level1id = -1;
$tmpsys_level2id = -1;
$tmpsys_level3id = -1;
$tmpsys_level4id = -1;
$tmpsys_level5id = -1;
$tmpsys_level6id = -1;
$tmpsys_level7id = -1;
$tmpsys_level8id = -1;
$tmpsys_level9id = -1;


//$data = array();

for($i=0;$i<$nrows;$i++)
{

$sys_Jobid = mssql_result($rs_queryres,$i,"projectid");
$sys_Jobtitle = mssql_result($rs_queryres,$i,"projecttitle");
$sys_levelid = mssql_result($rs_queryres,$i,"levelid");
$sys_level1id = mssql_result($rs_queryres,$i,"level1id");
$sys_level2id = mssql_result($rs_queryres,$i,"level2id");
$sys_level3id = mssql_result($rs_queryres,$i,"level3id");
$sys_level4id = mssql_result($rs_queryres,$i,"level4id");
$sys_level5id = mssql_result($rs_queryres,$i,"level5id");
$sys_level6id = mssql_result($rs_queryres,$i,"level6id");
$sys_level7id = mssql_result($rs_queryres,$i,"level7id");
$sys_level8id = mssql_result($rs_queryres,$i,"level8id");
$sys_level9id = mssql_result($rs_queryres,$i,"level9id");
$sys_TimeCreated=mssql_result($rs_queryres,$i,"TimeCreated");
$sys_Description=mssql_result($rs_queryres,$i,"description");

if ($sys_Jobid <> $tempsys_jobid)
{
if($i>=0)
{

//$data[$i]= "PROJECT NAME:".$sys_Jobtitle;

}
}

$Queryfields = "select projectformfields1.fieldid as controlid,projectformfields1.label as controlname,projectformfields1.levelid
from projectformfields1
where
projectformfields1.projectid = '$sys_Jobid' and
projectformfields1.levelid = '$sys_levelid'
and displayflag=1
order by fieldid";

$rs_Fields = mssql_query($Queryfields);
$nrowfields = mssql_num_rows($rs_Fields);





$query = "select projectformdata.controlid,projectformdata.levelnam e,
projectformdata.controltype,projectformdata.fld_va rchar,projectformdata.fld_int,
convert(varchar,projectformdata.fld_date,101) as fld_date,projectformdata.fld_bool,
projectformdata.level1id,projectformdata.level2id, projectformdata.level3id,projectformdata.level4id,
projectformdata.level5id, projectformdata.level6id,projectformdata.level7id,
projectformdata.level8id,projectformdata.level9id
from projectformdata
where
projectformdata.projectid = '$sys_Jobid' and
projectformdata.levelid = '$sys_levelid' and
projectformdata.level1id = '$sys_level1id' and
projectformdata.level2id = '$sys_level2id' and
projectformdata.level3id = '$sys_level3id' and
projectformdata.level4id = '$sys_level4id' and
projectformdata.level5id = '$sys_level5id' and
projectformdata.level6id = '$sys_level6id' and
projectformdata.level7id = '$sys_level7id' and
projectformdata.level8id = '$sys_level8id' and
projectformdata.level9id = '$sys_level9id'
order by controlid";

$rs_projectformdata = mssql_query($query);
$nrowprojectformdata = mssql_num_rows($rs_projectformdata);


if($nrowprojectformdata > 0)
{
$formdata_curlevelname = mssql_result($rs_projectformdata,0,"levelname");
}
else
{
$formdata_curlevelname = "-Not Selected-";
}
if($sys_Jobid != $tempsys_jobid || $sys_levelid <> $tempsys_levelid)
{
//$val = "FORM NAME :".$formdata_curlevelname;
}



if ($sys_Jobid != $tempsys_jobid || $sys_levelid<> $tempsys_levelid || $sys_level1id <> $tmpsys_level1id ||
$sys_level2id <> $tmpsys_level2id || $sys_level3id <> $tmpsys_level3id || $sys_level4id <> $tmpsys_level4id ||
$sys_level5id <> $tmpsys_level5id || $sys_level6id <> $tmpsys_level6id || $sys_level7id <> $tmpsys_level7id ||
$sys_level8id <> $tmpsys_level8id || $sys_level9id <> $tmpsys_level9id)
{
$val1 = array();

for($tmp=0;$tmp<$nrowfields;$tmp++)
{

$formdata_cntrlName = mssql_result($rs_Fields,$tmp,"controlname");
$val1[$tmp] = $formdata_cntrlName;//"CNTRL NAME:".
}

}
}
return $val1;

}
}

function ProjectInfo4()
{

$queryres = "Select s.projectid,p.projecttitle,s.levelid,s.Level1ID,s. Level2ID,s.Level3ID,s.Level4ID,s.Level5ID,s.Level6 ID,s.Level7ID,s.Level8ID,s.Level9ID, s.description,convert(varchar,s.createdate,108) as TimeCreated from SystemAlerts s ,project p where s.projectid=p.projectid ORDER by s.levelid,s.Level1ID,s.Level2ID,s.Level3ID,s.Level 4ID,s.Level5ID,s.Level6ID,s.Level7ID,s.Level8ID,s. Level9ID";
$rs_queryres = mssql_query($queryres);
$nrows = mssql_num_rows($rs_queryres);
//return $nrows;---61
// $array = array();
if ($nrows >0)
{
$i=0;
$tempsys_jobid= 0;
$tempsys_levelid = -1;
$tmpsys_level1id = -1;
$tmpsys_level2id = -1;
$tmpsys_level3id = -1;
$tmpsys_level4id = -1;
$tmpsys_level5id = -1;
$tmpsys_level6id = -1;
$tmpsys_level7id = -1;
$tmpsys_level8id = -1;
$tmpsys_level9id = -1;


//$data = array();

for($i=0;$i<$nrows;$i++)
{

$sys_Jobid = mssql_result($rs_queryres,$i,"projectid");
$sys_Jobtitle = mssql_result($rs_queryres,$i,"projecttitle");
$sys_levelid = mssql_result($rs_queryres,$i,"levelid");
$sys_level1id = mssql_result($rs_queryres,$i,"level1id");
$sys_level2id = mssql_result($rs_queryres,$i,"level2id");
$sys_level3id = mssql_result($rs_queryres,$i,"level3id");
$sys_level4id = mssql_result($rs_queryres,$i,"level4id");
$sys_level5id = mssql_result($rs_queryres,$i,"level5id");
$sys_level6id = mssql_result($rs_queryres,$i,"level6id");
$sys_level7id = mssql_result($rs_queryres,$i,"level7id");
$sys_level8id = mssql_result($rs_queryres,$i,"level8id");
$sys_level9id = mssql_result($rs_queryres,$i,"level9id");
$sys_TimeCreated=mssql_result($rs_queryres,$i,"TimeCreated");
$sys_Description=mssql_result($rs_queryres,$i,"description");

if ($sys_Jobid <> $tempsys_jobid)
{
if($i>=0)
{

//$data[$i]= "PROJECT NAME:".$sys_Jobtitle;

}
}

$Queryfields = "select projectformfields1.fieldid as controlid,projectformfields1.label as controlname,projectformfields1.levelid
from projectformfields1
where
projectformfields1.projectid = '$sys_Jobid' and
projectformfields1.levelid = '$sys_levelid'
and displayflag=1
order by fieldid";

$rs_Fields = mssql_query($Queryfields);
$nrowfields = mssql_num_rows($rs_Fields);





$query = "select projectformdata.controlid,projectformdata.levelnam e,
projectformdata.controltype,projectformdata.fld_va rchar,projectformdata.fld_int,
convert(varchar,projectformdata.fld_date,101) as fld_date,projectformdata.fld_bool,
projectformdata.level1id,projectformdata.level2id, projectformdata.level3id,projectformdata.level4id,
projectformdata.level5id, projectformdata.level6id,projectformdata.level7id,
projectformdata.level8id,projectformdata.level9id
from projectformdata
where
projectformdata.projectid = '$sys_Jobid' and
projectformdata.levelid = '$sys_levelid' and
projectformdata.level1id = '$sys_level1id' and
projectformdata.level2id = '$sys_level2id' and
projectformdata.level3id = '$sys_level3id' and
projectformdata.level4id = '$sys_level4id' and
projectformdata.level5id = '$sys_level5id' and
projectformdata.level6id = '$sys_level6id' and
projectformdata.level7id = '$sys_level7id' and
projectformdata.level8id = '$sys_level8id' and
projectformdata.level9id = '$sys_level9id'
order by controlid";

$rs_projectformdata = mssql_query($query);
$nrowprojectformdata = mssql_num_rows($rs_projectformdata);


if($nrowprojectformdata > 0)
{
$formdata_curlevelname = mssql_result($rs_projectformdata,0,"levelname");
}
else
{
$formdata_curlevelname = "-Not Selected-";
}
if($sys_Jobid != $tempsys_jobid || $sys_levelid <> $tempsys_levelid)
{
//$val = "FORM NAME :".$formdata_curlevelname;
}



if ($sys_Jobid != $tempsys_jobid || $sys_levelid<> $tempsys_levelid || $sys_level1id <> $tmpsys_level1id ||
$sys_level2id <> $tmpsys_level2id || $sys_level3id <> $tmpsys_level3id || $sys_level4id <> $tmpsys_level4id ||
$sys_level5id <> $tmpsys_level5id || $sys_level6id <> $tmpsys_level6id || $sys_level7id <> $tmpsys_level7id ||
$sys_level8id <> $tmpsys_level8id || $sys_level9id <> $tmpsys_level9id)
{
$val1 = array();

for($tmp=0;$tmp<$nrowfields;$tmp++)
{

$formdata_cntrlName = mssql_result($rs_Fields,$tmp,"controlname");
$val1[$tmp] = $formdata_cntrlName;//"CNTRL NAME:".
}

}
$tmpform_level1id = -1;
$tmpform_level2id = -1;
$tmpform_level3id = -1;
$tmpform_level4id = -1;
$tmpform_level5id = -1;
$tmpform_level6id = -1;
$tmpform_level7id = -1;
$tmpform_level8id = -1;
$tmpform_level9id = -1;
if($nrowprojectformdata>0)
{
for($j=0;$j<$nrowprojectformdata;$j++)
{
$curvarcharfield = mssql_result($rs_projectformdata,$j,"fld_varchar");
$curintegerfield = mssql_result($rs_projectformdata,$j,"fld_int");
$curdatefield = mssql_result($rs_projectformdata,$j,"fld_date");
$curbooleanfield = mssql_result($rs_projectformdata,$j,"fld_bool");
$form_level1id = mssql_result($rs_projectformdata,$j,"level1id");
$form_level2id = mssql_result($rs_projectformdata,$j,"level2id");
$form_level3id = mssql_result($rs_projectformdata,$j,"level3id");
$form_level4id = mssql_result($rs_projectformdata,$j,"level4id");
$form_level5id = mssql_result($rs_projectformdata,$j,"level5id");
$form_level6id = mssql_result($rs_projectformdata,$j,"level6id");
$form_level7id = mssql_result($rs_projectformdata,$j,"level7id");
$form_level8id = mssql_result($rs_projectformdata,$j,"level8id");
$form_level9id = mssql_result($rs_projectformdata,$j,"level9id");

if($curvarcharfield != ""){$curfieldvalue = $curvarcharfield;}
if($curintegerfield != ""){$curfieldvalue = $curintegerfield;}
if($curdatefield != ""){$curfieldvalue = $curdatefield;}
if($curlistfield != ""){$curfieldvalue = $curlistfield;}
if($curbooleanfield != ""){$curfieldvalue = $curbooleanfield;}
if($curvarcharfield == "" && $curintegerfield == "" && $curdatefield == "" && $curlistfield == "" && $curbooleanfield == "")
{
$curfieldvalue = "";
}
if ($form_level1id <> $tmpform_level1id ||
$form_level2id <> $tmpform_level2id ||
$form_level3id <> $tmpform_level3id ||
$form_level4id <> $tmpform_level4id ||
$form_level5id <> $tmpform_level5id ||
$form_level6id <> $tmpform_level6id ||
$form_level7id <> $tmpform_level7id ||
$form_level8id <> $tmpform_level8id ||
$form_level9id <> $tmpform_level9id )
{


$tmpColCount=0;

}

$val2[$j]=$curfieldvalue;
$tmpColCount+=1;
//print "</td>";
$tmpform_level1id = $form_level1id;
$tmpform_level2id = $form_level2id;
$tmpform_level3id = $form_level3id;
$tmpform_level4id = $form_level4id;
$tmpform_level5id = $form_level5id;
$tmpform_level6id = $form_level6id;
$tmpform_level7id = $form_level7id;
$tmpform_level8id = $form_level8id;
$tmpform_level9id = $form_level9id;

if ($form_level1id <> $tmpform_level1id ||
$form_level2id <> $tmpform_level2id ||
$form_level3id <> $tmpform_level3id ||
$form_level4id <> $tmpform_level4id ||
$form_level5id <> $tmpform_level5id ||
$form_level6id <> $tmpform_level6id ||
$form_level7id <> $tmpform_level7id ||
$form_level8id <> $tmpform_level8id ||
$form_level9id <> $tmpform_level9id )
{

}
}
}
else
{
$tmp=0;

for($tmp=0;$tmp<$nrowfields;$tmp++)
{
//print "<td bordercolor =$butovercolor>&nbsp;</td>";
}
}
if($nrowfields!=$tmpColCount)
{
for ($col=0;$col<($nrowfields-$tmpColCount);$col++)
{

}
}

$tempsys_jobid = $sys_Jobid;
$tempsys_levelid = $sys_levelid;
$tmpsys_level1id = $sys_level1id;
$tmpsys_level2id = $sys_level2id;
$tmpsys_level3id = $sys_level3id;
$tmpsys_level4id = $sys_level4id;
$tmpsys_level5id = $sys_level5id;
$tmpsys_level6id = $sys_level6id;
$tmpsys_level7id = $sys_level7id;
$tmpsys_level8id = $sys_level8id;
$tmpsys_level9id = $sys_level9id;
if ($sys_Jobid <> $tempsys_jobid)
{
//print "</table>";
}


//



}
//$array = array($data,$val,$val1,$val2);
//return $array[3];
return $val2;
//return $val1;//$val1."&".$val2;
//return $val;
//return $data;
//return $nrowfields;//$rs_Fields;
//return $nrowprojectformdata;//$rs_projectformdata;

}

}


}
?>


Thanks in advance.