Jump to content

Hrvoje

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by Hrvoje

  1. Thanks, finaly got it
  2. How to define that two classes in php and echo it. How to integrate it: ex... $color1="#000000"; $color2="#FFFFFF";
  3. This is code that show that records: <?PHP include("config.php"); $sql="SELECT * FROM stanje_lijekova ORDER BY naziv_lijeka ASC"; if (!$q=mysql_query($sql)) { echo "Error" . mysql_query(); die(); } if (mysql_num_rows($q)==0) { echo "No data!"; } else { while ($redak=mysql_fetch_array($q)) { echo " <div class='podatak'> <div class='naziv_lijeka_p'><p class='polje_tekst'> ".$redak['naziv_lijeka']."</p></div> <div class='sifra_p'><p class='polje_tekst'> ".$redak['sifra']."</p></div> <div class='jed_mjera_p'><p class='polje_tekst'> ".$redak['mjera']."</p></div> <div class='kolicina_p'><p class='polje_tekst'> ".$redak['kolicina']."</p></div> <div class='ostalo_p'><p class='polje_tekst'></p></div> </div>"; }}; ?> I apologise for wrong code upper.
  4. Ok, I understand this. Thanks I know how to select all rows with value '0'. But how to echo ex... color1 for records that have 0 in field kolicina?
  5. My mistake with mysql_num_rows. If there is any 0 in any field I want to echo diferent color to div class. Like in last picture.
  6. Hello, need some help. I have this code to see if there is any 0 number in field. <?PHP $boja1="divclass1"; $boja2="divclass2"; $provjera="SELECT kolicina FROM stanje_lijekova WHERE kolicina= 0"; if (!$q=mysql_query($provjera)) { echo "Error" . mysql_query(); die(); } if (mysql_num_rows($q)>0) { $boja1; } else { $boja2; } ?> How can I make this code to echo one of two variables with div class. If row have number 0 in field than my class need divclass1 if any other number than is divclass2. <div class='here i need that echo'>some code</div> And my dba: This is classic mouse hover css:
×
×
  • 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.