Thanks for the link. I had never came across that function before. I guess I didn't look hard enough!
Quote:
Well, now this query... must be getting done more times, right? Are you sure you actually need that one
|
Yes, that's right.
If I remove that query and use
PHP Code:
$optionselected = ($viewCountry['id'] == $editService['country']) ? 'selected="selected"' : '';
as you suggested above, it adds selected to each row for each item.
For example:
Row 1: Dog Trainer in UK
HTML Code:
<td><select class="primary" name="country[3]" tabindex="1">
<option value="1" class="" >Australia</option>
<option value="2" class="" >Canada</option>
<option value="3" class="">New Zealand</option>
<option value="4" class="" selected="selected">United Kingdom</option>
<option value="5" class="" >United States</option>
</select></td>
Row 2: Baby Sitter in the US
HTML Code:
<td><select class="primary" name="country[3]" tabindex="1">
<option value="1" class="" >Australia</option>
<option value="2" class="" >Canada</option>
<option value="3" class="">New Zealand</option>
<option value="4" class="" selected="selected">United Kingdom</option>
<option value="5" class="" selected="selected">United States</option>
</select></td>
Row 3: Plumber in NZ
HTML Code:
<td><select class="primary" name="country[3]" tabindex="1">
<option value="1" class="" >Australia</option>
<option value="2" class="" >Canada</option>
<option value="3" class="" selected="selected">New Zealand</option>
<option value="4" class="" selected="selected">United Kingdom</option>
<option value="5" class="" selected="selected">United States</option>
</select></td>
I think you're on the right track tho, because that is the query running over and over and over and over again... by commenting it out, it dropped to 11 queries.
Thanks Kevin.
I'm gonna head off (almost 2am here), and play with this again tomorrow.