php mysql problem...

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
stjepko [ Di, 13 März 2007 23:14 ] [ ID #1656352 ]

Re: php mysql problem...

stjepko wrote:
> I have a problem in my code... I want to order by rednibr table in podartikli....how?

$sqlpodartikli = "SELECT * FROM podartikli WHERE artiklid=".$row[id]."
ORDER BY rednibr";


--

//Aho
Shion [ Di, 13 März 2007 23:24 ] [ ID #1656353 ]

Re: php mysql problem...

"J.O. Aho" <user [at] example.net> wrote in message
news:55oml7F25eh18U1 [at] mid.individual.net...
> stjepko wrote:
>> I have a problem in my code... I want to order by rednibr table in
>> podartikli....how?
>
> $sqlpodartikli = "SELECT * FROM podartikli WHERE artiklid=".$row[id]."
> ORDER BY rednibr";
>
>
> --
>
> //Aho

I done that but after that i did not get any resultat out :(
but tnx...
stjepko [ Mi, 14 März 2007 00:46 ] [ ID #1656355 ]

Re: php mysql problem...

stjepko wrote:
> "J.O. Aho" <user [at] example.net> wrote in message
> news:55oml7F25eh18U1 [at] mid.individual.net...
>> stjepko wrote:
>>> I have a problem in my code... I want to order by rednibr table in
>>> podartikli....how?
>> $sqlpodartikli = "SELECT * FROM podartikli WHERE artiklid=".$row[id]."
>> ORDER BY rednibr";
>
> I done that but after that i did not get any resultat out :(
> but tnx...

Check that your select query is correct, echo it out can help.
Do use mysql_error() to see if there is some other errors

echo mysql_errno() . ": " . mysql_error() . "<br>\n";


Of course you can order things in php, but thats a lot more work storing
it an a big array and then sort it.This will consume more memory and
take longer time.

Fix your mail client too, there shouldn't been any row below this one in
your reply.
--

//Aho
Shion [ Mi, 14 März 2007 01:01 ] [ ID #1656356 ]

Re: php mysql problem...

Post removed (X-No-Archive: yes)
Notifier Deamon [ Do, 15 März 2007 18:33 ] [ ID #1658673 ]
PHP » alt.php.sql » php mysql problem...

Vorheriges Thema: Formatting output from database
Nächstes Thema: Dynamic websites with reward points for members