Greywacke Posted April 22, 2010 Share Posted April 22, 2010 hi all,i've got a slight issue to resolve.i need to find out why the following function's code in bold is not returning the make/model/style, despite them being returned in another function. function gettransactions() { //= supplier id, >= from and <= to dates as available create constraints // ".(($numargs>0)?" WHERE ":"").join(" AND ",$arg_list)." $arr = array(); if ($GLOBALS["s"] > 0) { array_push($arr,"13_prospectleadsent.bigint_SupplierID = ".$GLOBALS["s"]); } array_push($arr,"13_prospectleadsent.timestamp_Sent >= \"".$GLOBALS["f"]."\""); array_push($arr,"13_prospectleadsent.timestamp_Sent <= \"".$GLOBALS["t"]."\""); $sql = "SELECT 10_serviceprospects.bigint_ProspectID, 13_prospectleadsent.smallint_ProspectOrdinal, 13_prospectleadsent.timestamp_Sent, 10_serviceprospects.text_LeadAttributes, 10_serviceprospects.text_Consumer, 1_regions.text_RegionDescription FROM 13_prospectleadsent LEFT JOIN 10_serviceprospects ON ( 13_prospectleadsent.bigint_ProspectID = 10_serviceprospects.bigint_ProspectID ) LEFT JOIN 1_regions ON ( 10_serviceprospects.bigint_RegionID = 1_regions.bigint_RegionID )". ((count($arr)>0)? " WHERE ".join(" AND ",$arr): ""). " ORDER BY 13_prospectleadsent.timestamp_Sent ASC;"; $result = mysql_query_errors($sql , $conn , __FILE__ , __LINE__ , false); if ($result) { while ($row = mysql_fetch_array($result)) {[b] $attr = split("<br />",$row1["text_LeadAttributes"]); $req = ""; $mak = ""; $stl = ""; foreach ($attr as $value) { $val = split(" = ",$value); if (stristr($val[0],"product")) { $req = trim($val[1]); } elseif (stristr($val[0],"make_model")) { $mak = trim($val[1]); } elseif (stristr($val[0],"style")) { $stl = trim($val[1]); } } if (strlen($req)==0) { $req = $mak." ".$stl; }[/b] $consumer = split(";",$row["text_Consumer"]);[color="#FF0000"] $ret .= "<div class=\"gw003\"><div class=\"leadid\">#". (intval($row["bigint_ProspectID"]) + 9001100)."-". $row["smallint_ProspectOrdinal"]. "</div><div class=\"timestamp\">".$row["timestamp_Sent"]. "</div><div class=\"makestyle\">".xmlentities([b]$req[/b]). " (".$row["text_RegionDescription"].", ".$consumer[3]. ")</div><div class=\"consumer\">". $consumer[0]." (".$consumer[1].")</div></div>\n";[/color] } } return $ret;} below is a link to a screenshot of what the mail looks like at the moment, with the missing make/model/style values:Received Mail Screenshot.the sql string selects the leads within the selected parameters/constraints, xmlentities merely replaces &, <, > and other characters with their html or numeric entities.however, $req = an empty string here, it is supposed to contain the same values as shown in the preview below (retrieved to xml with the same code, in another function).Mail Preview Screenshot.i've been through the sql statement, the code in bold that parses the attributes - and still get nothing.it is possible that the code in red is not properly formatted however.somebody please help! Link to comment Share on other sites More sharing options...
Greywacke Posted April 22, 2010 Author Share Posted April 22, 2010 oh nevermind, lol the attribute retrieval code was deprecated. $attr = split("<br />",$row1["text_LeadAttributes"]); it should be as follows: $attr = split("<br />",$row["text_LeadAttributes"]); issue resolved! :)a screenshot of the mail as intended can be viewed here. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.