|
Posted by Tom on 03/15/07 17:33
On Tue, 13 Mar 2007 23:14:25 +0100, stjepko wrote...
>
>I have a problem in my code...this is a one php file wich is included in
>another php file
>--------------------------------------
><table>
><?php
>$sqlpodartikli = "SELECT * FROM podartikli WHERE artiklid=".$row[id];
>
>$result2 = mysql_query($sqlpodartikli) ;
> if($result2)
> {
> while($row2 = mysql_fetch_array($result2))
> {
>?>
><tr>
> <td><?php echo $row2[rednibr]; ?></td>
> <td><?php echo $row2[opis]; ?></td>
> <td><?php echo $row2[proizvodjac]; ?></td>
> <td><?php echo $row2[sifra]; ?></td>
> <td><?php echo $row2[cijena]; ?></td>
></tr>
><?php
> }
> }
>?>
></table>
>-----------------
>
>I want to order by rednibr table in podartikli....how?
>tnx
>
>
I wasn't sure if you were trying to order the results by the "rednibr" column..
$sqlpodartikli = "SELECT * FROM podartikli WHERE artiklid="
. $row[id] . " order by rednibr";
or if you were trying to get the column names in the right order? If you needed
the column names in a specific order, you can replace the "select * from..."
with the names of the columns in the order you want...
$sqlpodartikli = "SELECT rednibr, opis, proizvodjac, sifra, cijena FROM
podartikli WHERE artiklid=" . $row[id];
Tom
--
Newsguy.com
Basic Accounts $39.95 / 12 months
[Back to original message]
|