I am one step *before* clueless newbie, so I hope you'll bear with me <smile>.
In the output, I need to be able to add punctuation after the information in the Duration field if it contains an entry. I cannot figure out how to do that.
I need the output to read like this:
"blah blah blah A great addition to the repertoire. 7 minutes. Ref: 114a9"
but it appears like this:
"blah blah blah A great addition to the repertoire. 7 minutes Ref: 114a9"
This is the code I have thus far:
<?php
include("connectData.inc");
$type="{$_GET['subType']}";
$query = "SELECT * FROM blItem WHERE blSubType='$type'";
echo "<table cellspacing='0' border='0' cellpadding='0'
width='100%'>";
$result = mysql_query($query) or die ("Error: $query");
while ($row = mysql_fetch_array($result)) {
extract($row);
echo "<tr>\n";
echo "<td>{$Title} {$Composer} {$bpSolo} {$Desc} {$Duration} Ref: {$Id}</td>\n";
echo "<td>{$grade}</td>\n";
echo "<td>{$price}</td>\n";
} // end while
echo "</table>\n";
$var = NULL;
?>
Any help gratefully accepted. <smiles>
nascent
how do I add punctuation to output?
Page 1 of 13 Replies - 4074 Views - Last Post: 11 June 2005 - 11:27 PM
Replies To: how do I add punctuation to output?
#2
Re: how do I add punctuation to output?
Posted 11 June 2005 - 05:06 PM
Change
to
or, to make it conditional on the contents of the duration field
echo "<td>{$Title} {$Composer} {$bpSolo} {$Desc} {$Duration} Ref: {$Id}</td>\n";
to
echo "<td>{$Title} {$Composer} {$bpSolo} {$Desc} {$Duration}. Ref: {$Id}</td>\n";
or, to make it conditional on the contents of the duration field
echo "<td>{$Title} {$Composer} {$bpSolo} {$Desc} {$Duration}\n";
if($Duration!="")
echo ".";
echo "Ref: {$Id}</td>\n";
#3
Re: how do I add punctuation to output?
Posted 11 June 2005 - 09:08 PM
Amadeus,
My sincere thanks to you. It was exactly what I needed. <smiles>
nascent
My sincere thanks to you. It was exactly what I needed. <smiles>
nascent
#4
Re: how do I add punctuation to output?
Posted 11 June 2005 - 11:27 PM
No problem at all...welcome to dreamincode. Please feel free to ask any questions you wish.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|