Jump to content

basing one mysql output from current table


peehaichpee

Recommended Posts

if I'm outputting from mysql with this:

 

 // Connects to your Database 
mysql_connect("localhost", "root", "") or die(mysql_error()) ; 
mysql_select_db("test") or die(mysql_error()) ; 

//Retrieves data from MySQL 
$data = mysql_query("SELECT * FROM tickets") or die(mysql_error()); 

//Puts it into an array 
while($info = mysql_fetch_array( $data )) { 
//Outputs the image and other data 


Echo "<b>asset number:</b> ".$info['AssetNumber'] . "<br> ";
Echo "<b>subject:</b> ".$info['subject'] . " <br>"; 
Echo "<b>notes:</b> ".$info['Notes'] . " <hr>"; }

 

can I base the record it outputs somehow on this:

 


$value="";
$value = ProcessLargeText(GetData($data,"Asset Number", ""),"","",MODE_VIEW);
if($mainTableOwnerID=="Asset Number")
	$ownerIdValue=$value;
$xt->assign("Asset_Number_value",$value);
if(!$pageObject->isAppearOnTabs("Asset Number"))
	$xt->assign("Asset_Number_fieldblock",true);
else
	$xt->assign("Asset_Number_tabfieldblock",true);

 

It's kind of like a job history so its getting records of job history from one table while the second piece of code is getting the asset details from a main table

the trouble is I'm modifying existing code and the array has been arranged like so:

$fieldsArr = array();
$arr = array();
$arr['fName'] = "Asset Number";
$arr['viewFormat'] = ViewFormat("Asset Number", $strTableName);
$fieldsArr[] = $arr;
$arr = array();
$arr['fName'] = "Asset Description";
$arr['viewFormat'] = ViewFormat("Asset Description", $strTableName);

 

so what I want to do is add a table at the bottom with my SQL statement to only show matching records based on that asset number on this page....

 

is that possible with the way the array has been done?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.