Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a MySQL DB table name category that looks like the table below:
I would like to create a query to output rows from the DB using an array and while statement were the rows are asceding and listed by the view and cat_id order just as the example below.
[syntax="html"]
<table>
<tr>
<td>cat_id</td>
<td>view</td>
<td>cat_name</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>Polices</td>
</tr>
<tr>
<td>2</td>
<td>1</td>
<td>Travel_Exp</td>
</tr>
<tr>
<td>3</td>
<td>2</td>
<td>MyMoney</td>
</tr>
<tr>
<td>4</td>
<td>0</td>
<td>SOP</td>
</tr>
<tr>
<td>5</td>
<td>2</td>
<td>Funds</td>
</tr>
<tr>
<td>6</td>
<td>1</td>
<td>Sales</td>
</tr>
<tr>
<td>7</td>
<td>4</td>
<td>Buying</td>
</tr>
</table>
Query output list should look like this:
Policies
travel_Exp
MyMoney
Funds
Tokens
Sales
SOP
Buying
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]