Why can I not access a field of my mysqli result with $row['price'+$i+'dollar'] with PHP?
<p>In a database I'm working with, there are 6 columns with names:</p>

<pre><code>price1dollar
price2dollar
price3dollar
price4dollar
price5dollar
price6dollar
</code></pre>

<p>I thought that once I had the result set for the query, I could access it like so with PHP:</p>

<pre><code>for($i = 1; $i &lt;= 6; $i++) {
    echo $row['price'+$i+'dollar'].'&lt;br /&gt;';
}
</code></pre>

<p>and that would print out all the values, but I'm not getting anything printed.</p>

<p>if I use:</p>

<pre><code>echo $row['price1dollar'];
</code></pre>

<p>then the value is printed out fine.</p>

<p>I have <code>echo</code>ed the value of <code>$i</code> and it prints out 1 to 6 fine, so I don't know whats going on.</p>

<p>Is the <code>$row['price'+$i+'dollar']</code> syntax not allowed?</p>

<p>Many thanks</p>
