Jump to content

3p1demicz

New Members
  • Posts

    3
  • Joined

  • Last visited

3p1demicz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you very much!! it made my day
  2. here is the code. <?php $request = mysql_query("SELECT * FROM database WHERE ean = '12' ") or die (mysql_error()); $calculation1 = ($price / $weight); while ($row = mysql_fetch_array($request)) { echo "$row[name] and $row[weight]<br>"; echo "$row[price] and $calculation1 <br>"; echo "<br><br>"; } Can you explain more? I have the calculation after selecting data from the database. Should i put the if statment before the while, is that what you suggest?
  3. Dear people, I have a problem for solving. I have numbers in my database saved with decimal atribute. The numbers go below zero like this '0.55' and also above zero. I' m just testing my code and i came to this Dividing by zero problem. I need to do simple devision $variable / $ variable to get a needed number for my operation, but it just does not work ... help me pls. If i do it manually it works for ex. 0.55/ 0.2 = 2.75. I need to get this same output from my variables. I do much appriciate any hints where to fix this
×
×
  • 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.