Jump to content

Rascii

Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by Rascii

  1. Well I figured out that the problem is when I add, for example, 5.00 + 7,345.00, PHP just adds 5 + 7 (disregarding everything after the comma). It looks like number_format doesn't allow you to not use a comma, though for some reason print_f doesn't work when defined as a variable. Are there any other functions to use or am I just using these ones incorrectly? [code]$estTotal = $estTotal + $amount; $estTotal = printf ('$%0.2f', $estTotal);[/code] Nevermind, I figured it out. All I needed to use was: [code]number_format ($estTotal, 2, '.', '');[/code]
  2. Okay so I'm using [code]number_format ($partsInfo[Price], 2);[/code] which works perfectly until the number reaches 1,000.00 at which point it rolls back to 1.00 (note: this is for $estTotal, shown below). Any idea why it would be doing this? Below is the majority of the code: [code]while($partsOrder = mysql_fetch_array($getPartsOrder)) { $partsInfo = mysql_fetch_array(mysql_query("SELECT * FROM Parts WHERE Number='$partsOrder[Number]'")); $row_color = ($row_count % 2) ? $color1 : $color2; $partsInfo[Price] = priceConversion($partsInfo[Price]); $partsInfo[Price] = number_format ($partsInfo[Price], 2); $amount = $partsOrder[Quantity] * $partsInfo[Price]; $amount = number_format ($amount, 2); $estTotal = $estTotal + $amount; $estTotal = number_format ($estTotal, 2);[/code] Also, I just realized that it only does this if $amount is greater than 1,000. If $estTotal is greater than 1,000 it seems to work fine. Another edit: It seems to be more on the random side. This is frustrating. :( Thank you ahead of time if you have any ideas!
  3. I have a page that multiplies an amount of a part by the quantity of that part, then gives a total. For example: PART (costs $5.00, quantity of 3) That yields a total of $15. I want to it say $15.00 and I want it to round to the hundreths place in circumstances where a part may cost $3.6554, for example. How can I achieve this?
  4. There are 27,070 rows taking up 2.6 MB and 598.9 KB of space. I feel like it would be impossible to do all of this chunk by chunk so I guess I am just going to forget about moving the forum threads. If anyone can think of any suggestions please let me know. :-\
  5. The import... It just freezes up the browser.
  6. Well I can't seem to export the gigantic tables and import them again. Any ideas on how I could do this?
  7. One last question: The database for my forums has 27,093 rows (3.2 MB) and I'm having trouble moving it. Should I just start the forums afresh or keep trying?
  8. Thank you! You were extremely helpful. I'm going to give it a try tonight.
  9. Okay so I'm moving hosts right now and I have tons of mysql stuff that I need to move from one host to the next. I figured I could just use the "Export" feature in phpMyAdmin, save it to my hard drive, then use the SQL feature to run the INSERTs in the phpMyAdmin for the new host. Turns out, it isn't working. I think the problem is that there is a "(Max: 2,048KB)". The database that I exported is "2.58 MB (2,712,543 bytes)". So I have a few questions: 1. Is my best option to export and import table by table? 2. When exporting, what are the best options to use? I don't understand what the following are for or if they are necessary: a. "Enclose export in a transaction" b. "Disable foreign key checks" c. "Add DROP TABLE" d. "Add IF NOT EXISTS" e. "Complete inserts" f. "Extended inserts" g. Maximum length of created query h. "Use delayed inserts" i. "Use ignore inserts" 3. What type of compression is best? (Right now I am using "None".) I would like to say thanks ahead of time to anyone who helps me out with this. I appreciate it!
×
×
  • 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.