| Author |
php mysql problem...
|
|
| stjepko 2007-03-13, 7:01 pm |
| 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
| |
| J.O. Aho 2007-03-13, 7:01 pm |
| 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
| |
| stjepko 2007-03-13, 7:01 pm |
|
"J.O. Aho" <user@example.net> wrote in message
news:55oml7F25eh18U1@mid.individual.net...
> stjepko wrote:
>
> $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...
| |
| J.O. Aho 2007-03-13, 7:01 pm |
| stjepko wrote:
> "J.O. Aho" <user@example.net> wrote in message
> news:55oml7F25eh18U1@mid.individual.net...
>
> 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
| |
|
| 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
|
|
|
|