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

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.