hello. i'm querying multiple fields from my db, each of which have an identical prefix and incrementing numbers from 01 - 22 (so it's rt01 - rt22).
i want to retrieve w/ a single row SELECT query, output containing the value of each of those fields, consecutively.
i'm getting no output (no warnings or notices either though), so my first thought is when my for loop counts the integers from 1 - 22 and concatenats that onto the string, "rt", PHP isn't interpreting that i want it to read the result as a variable-- but instead, it's taking it literally as a string-- i think...
$htmlblock = "<p>The route times for this bus stop $stop_code are:</p>
<ul>";
for($x=1;$x>=22;$x++){
$pad = str_pad($x, 2, "0", STR_PAD_LEFT);
$pad = sprintf(d,$pad);
$fieldname = "'$rt'".$pad;
$htmlblock .= "<li>".$fieldname."</li>";
}
$htmlblock .="</ul>";
is this the way i want to set it up, and if so, then type specifier should i be using instead, mixed w/ what kind of string (single quotes, double quotes, etc)?
thanks!!!