Re: can't output sql query with php code.
| From: | Jay Paulson | Date: | Mon, 06 Feb 2006 15:15:28 +0000 |
| Subject: | Re: can't output sql query with php code. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229951@lists.php.net to get a copy of this message | ||
It always helps to have a different point of view to look at code sometimes.
Else you'll go bonkers looking for that stupid semi-colon! :)
On 2/6/06 2:18 AM, "Paul Goepfert" <paul.goepfert@gmail.com> wrote:
> Thanks everyone for your help. I should have seen the semi-colon at
> the end of the while loop. I must have looked at the code 20 times
> and I can't believe I missed it.
>
> Paul
> On 2/6/06, Brady Mitchell <bradym@ext.usu.edu> wrote:
>>> <?php
>>> echo '<select name="month" >\n';
>>> $month_query = mysql_query("SELECT m_id, months FROM Month");
>>> while ($r = mysql_fetch_array($month_query));
>>
>>
>> Remove the semi-colon at the end of the above line and it works like a charm.
>>
>>> {
>>> $v = $r["m_id"];
>>> $out = $r["months"];
>>> echo "<option value=$v>$out</option>\n";
>>> }
>>> echo '</select>\n';
>>> ?>
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php