Hi,
First off appologies to people who have read this on other forums, as I have posted it in various places.
I have got an include file that contains my query to return the countries that are within my database. I have then written a function that loops over that result set and creates a HTML select.
This works fine the first time I use the function, but the second time it doesn't output anything!
I have a feeling that this is something to do with the where the record pointer is at!
Is there anyway of moving the pointer back to the start of the records?
this is the output code:
function writeSelect($FormFieldName, $dbObject, $JoinField, $UpdateIdent, $DisplayValue, $ItemMatch) {
print ("<select name=\"$FormFieldName\">\n"
;
while ($SelectRow = mysql_fetch_assoc($dbObject)) {
print ("<option value=\"$SelectRow[$JoinField]\""
;
if (IsSet($_GET[$UpdateIdent])) {
if ($SelectRow[$JoinField] == $ItemMatch) {
echo " selected";
}
}
print (">$SelectRow[$DisplayValue]</option>\n"
;
}
print ("</SELECT>"
;
}
TIA
Tony
First off appologies to people who have read this on other forums, as I have posted it in various places.
I have got an include file that contains my query to return the countries that are within my database. I have then written a function that loops over that result set and creates a HTML select.
This works fine the first time I use the function, but the second time it doesn't output anything!
I have a feeling that this is something to do with the where the record pointer is at!
Is there anyway of moving the pointer back to the start of the records?
this is the output code:
function writeSelect($FormFieldName, $dbObject, $JoinField, $UpdateIdent, $DisplayValue, $ItemMatch) {
print ("<select name=\"$FormFieldName\">\n"

while ($SelectRow = mysql_fetch_assoc($dbObject)) {
print ("<option value=\"$SelectRow[$JoinField]\""

if (IsSet($_GET[$UpdateIdent])) {
if ($SelectRow[$JoinField] == $ItemMatch) {
echo " selected";
}
}
print (">$SelectRow[$DisplayValue]</option>\n"

}
print ("</SELECT>"

}
TIA
Tony