Jump to content

Recommended Posts

Hey guys,

 

How can I idnetify which row is which. I'm using this code:

 

$upit = "SELECT * FROM opisi JOIN slike ON opisi.opis_id = slike.id ORDER BY datum DESC LIMIT 4";
$rezultat = mysql_query($upit,$veza) or die (mysql_error());
while($values = mysql_fetch_array($rezultat)){

 

How can I say..

 

Echo row1

Echo row2

...

Echo row4

Link to comment
https://forums.phpfreaks.com/topic/121024-solved-identifing-rows/
Share on other sites

OK, to clarify a little bit more.

 

I have 4 divs, and each one I want to put data I'm getting in this loop.

 

while($row = mysql_fetch_array($rezultat)){
$opis_id = $row["opis_id"];
$opis = $row["opis"];
$datum = $row["datum"];
$unio = $row["unio"];
$lokacija = $row["lokacija"];
$zupanija = $row["zupanija"];
$drzava = $row["drzava"];
$kategorija = $row["kategorija"];
$link = $row["link"];
$naziv = $row["naziv"];

 

My problem is I wan't to put first row of DB to DIV1, second row of DB to DIV2, third row of DB to DIV3, fourth row of DB to DIV4.

How can I tell the program which row need's to go where???

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.