just a moment of your time please. I'm a novice and am changing someone else's code to suit me. my problem is this: I need to pull one extra field out of this guys DB table query - and use this extra field ($couple_id) in a query of my own. it is partially working. I am getting the $couple_id, but query is not working right as the value has been changed by wordwrap function.

his query:
$q = $this->queryEngine("select *, date_format(created, '%b %e, %Y ".LANG_14." %l:%i %p') as `created2` from ".DB_TABLE." where parent = '$board2' order by date asc",$this->dbo);

then here is where he gets his stuff: my code has comments:
while($d = $this->dbo->spiderFetchArray($q))

foreach($d as $key => $val)
$$key = htmlentities(stripslashes($val));

if($key != 'parent' && $key != 'user' && $key != 'bid' && $key != 'created')
$$key = '<p>'.str_replace("\n", "</p><p>", $$key).'</p>';
} // end of IF key != parent, user, bid, and created
} // end of FOREACH

$post = preg_replace("/<p>\s<\/p>/i", "<p>&nbsp;</p>", $post);
$origpost = $post;
$post = $this->replaceCode($post,"quote","div","","quote");
$post = $this->replaceCode2($post,$tag='you',$tag2='',$style='');
$post = $this->replaceCode2($post,$tag='img',$tag2='img',$style='');
$post = $this->replaceCode2($post,$tag='url',$tag2='a',$style='');
$post = $this->replaceCode2($post,$tag='b',$tag2='strong',$style='');
$user = wordwrap($user, 16, "<br />", 1);
$post = wordwrap($post, 70, "<br />", 1);
// $couple_num = $this->$couple_id; // did not work!
$couple_num = wordwrap($couple_id, 16, "<br />", 1); // does echo right but my query does not like it!
echo "Couple id is: " . $couple_num;

my query:
$query = "SELECT * FROM $activity WHERE member_id = '$couple_num' LIMIT 1";
$info_remote = mysql_query($query);
if ($records_found > 0) { do some stuff... }
else {$message_text = "no activity found.";}

the code above echos the value for $couple_id - GOOD, but the query returns no records found. can you please tell me what is wrong with my attempt: $couple_num = $this->$couple_id; // did not work!

many thanks in advance! will return in a few hours.