php help...

I have code like this one. And and need to ORDER by rednibr ASC. Please how?
tnx
------------------------------------------------------------ --------------------------
<?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>
------------------------------------------------------------ ------------------------------------------
stjepko [ Fr, 09 Februar 2007 18:42 ] [ ID #1624486 ]

Re: php help...

stjepko wrote:
> I have code like this one. And and need to ORDER by rednibr ASC. Please how?
> tnx
> ------------------------------------------------------------ --------------------------
> <?php
>

/* Modify query for ORDER */
$sqlpodartikli = "SELECT * FROM podartikli WHERE artiklid=".$row[id]." ORDER
by rednibr ASC";

> $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>
> ------------------------------------------------------------ ------------------------------------------

Take a couple of hours of sleep and continue work on your php-script when you
feel fresh again.


--

//Aho
Shion [ Fr, 09 Februar 2007 19:05 ] [ ID #1624487 ]
PHP » alt.php.sql » php help...

Vorheriges Thema: Looping through 2 query results
Nächstes Thema: INSERTing and ENUMs