The data pair should only be included in the string if the variable contains a value and a comma should be appended at the end of each pair only if another pair is to be appended."2", "submitted by", "7", "Status", "8", "a short, concise description +", "536870915", "Jobfail", "536870922", "finance", "536870926", "Stev +ens"
The data and variables are layed out as follows:
Things I've tried that failed:..........................# VALUE CONTAINED IN THE VARIABLE "2", "$p_suby", # submitted by "7", "$p_stat", # Status "8", "$p_desc", # a short concise description "536870915", "$p_catg", # Jobfail "536870922", "$p_agrp", # finance "536870926", "$p_lnam" # Stevens
$counter = 0 ; if ($p_suby != "") {$tkt_data = "\"2\", \"$p_suby\"" ; $counter = $counter + 1 ;} if ($p_stat != "") {if ($counter > 0) {$tkt_data = "$tkt_data, \"7\", \"$p_stat\""} else {$tkt_data = "\"7\", \"$p_stat\""} $counter = $counter + 1 ;} if ($p_desc != "") {if ($counter > 0) {$tkt_data = "$tkt_data, \"8\", \"$p_desc\""} else {$tkt_data = "\"8\", \"$p_desc\""} $counter = $counter + 1 ;} if ($p_catg != "") {if ($counter > 0) {$tkt_data = "$tkt_data, \"536870915\", \"$p_catg +\""} else {$tkt_data = "\"536870915\", \"$p_catg\""} $counter = $counter + 1 ;} if ($p_agrp != "") {if ($counter > 0) {$tkt_data = "$tkt_data, \"536870922\", \"$p_agrp +\""} else {$tkt_data = "\"536870922\", \"$p_agrp\""} $counter = $counter + 1 ;} if ($p_lnam != "") {if ($counter > 0) {$tkt_data = "$tkt_data, \"536870926\", \"$p_lnam +\""} else {$tkt_data = "\"536870926\", \"$p_lnam\""} $counter = $counter + 1 ;}
In reply to My Novice is Showing by Red_Dragon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |