Jump to content

skinny

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

skinny's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. sorry for my following outburst: halalooooooya!!!!!!!!!!!! with the turning the price field into an integer and using SUBSTR(unit,1,6) it DID work : SELECT * FROM $usertable ORDER BY SUBSTR(unit,1,6),price WOW... I think I spent at least 5 hours on that... rediculous What you were saying was exactly true "If the text 'Third St #x' is part of the unit, there is no way it will order any differently than what you are currently getting because the x = 1,2,3,4,5 is part of what ORDER BY unit is using, so there is only one price per unique unit.". So using substr to get match the fist characters of the field PLUS changing the field from VARCHAR to INT worked. I can't thank you enough. I don't think I would have ever gone to sleep Thanks again for your time!
  2. I was afraid of that! So without breaking the data apart (creating a seperate field for the #x) is there a way I can group the units together (displaying them all of course) and then order by price? I tried the following in hopes of just reading the first 6 characters of the 'unit' (to ommit the #x) but with no luck: SELECT * FROM $usertable ORDER BY SUBSTR(unit,1,6),price Isn't there something similar I could do without breaking the table into more fields?
  3. No matter what I do the second ORDER gets ingnored and it only orders by the first field. The following orders by 'unit' and ignores 'price': SELECT * FROM $usertable ORDER BY unit,price The following orders by 'price' and ignores 'unit': SELECT * FROM $usertable ORDER BY price,unit I've tried adding DESC and ASC to end of each field (ex: price ASC) then one and not the other but the second field (unit,price) gets ignored from sorting. I feel like I've done this kind of sorting before but nothing's working. Seems so simple. My hair is almost gone
  4. If I order by 'unit' or 'price' seperately the results are ordered correctly but once I try to order by 'unit' first (essentially trying to group them) and then order by 'price' it does't work. What I need to do is group all of the 'unit's together and then order them in their group by 'price'. Appreciating your help!
  5. The dolloar sign and commas are added after are not in the actual data but the field was VARCHAR. I just changed it to INT but I'm not seeing any change in the results. Do I need to re-enter the data fot that field to make it register as numeric?
  6. My actual resutls are as follows when using (SELECT * FROM $usertable ORDER BY unit,price DESC) UNIT PRICE 105 Third St #1 - $1,381,000 105 Third St #2 - $761,000 105 Third St #3 - $769,500 105 Third St #4 - $311,500 105 Third St #5 - $670,500 107 Third St #1 - $1,381,000 107 Third St #2 - $761,000 107 Third St #3 - $769,500 107 Third St #4 - $311,500 107 Third St #5 - $710,500 What I need is: UNIT PRICE 105 Third St #4 - $311,500 105 Third St #5 - $670,500 105 Third St #2 - $761,000 105 Third St #3 - $769,500 105 Third St #1 - $1,381,000 107 Third St #4 - $311,500 107 Third St #5 - $710,500 107 Third St #2 - $761,000 107 Third St #3 - $769,500 107 Third St #1 - $1,381,000 Thanks for replying!
  7. Hello, I've spent wAy too long trying to figure this out. I know I'm missing some rediculously minor detail but everything I've tried has not worked. I have a table that I need to sort in two ways. I first need to put/list all of the matching names together and then sort them by price. For example: nameA = $10 nameB = $15 nameC = $30 nameA = $5 nameB = $20 nameC = $25 needs to result as: nameA = $5 nameA = $10 nameB = $15 nameB = $20 nameC = $25 nameC = $30 My thoughts were that the following should work: SELECT * FROM $usertable ORDER BY unit DESC, price DESC So to recap. All I'm trying to do is get my results to match fields together and then order them by price. Any help will be very much appreciated!
  8. Thank you crazy much for your help. You put me on the right track which allowed me to find another class for re-creating IPMT(): http://www.phpclasses.org/browse/package/892.html Thanks again!!
  9. Hi Mark, Thank you for the help!! I'm trying to implement the code and have one question. It seems I'm missing the "flattensinglevalue()" function. I'm getting this error when trying to run: Fatal error: Call to undefined method PHPExcel::flattensinglevalue() The code I'm using to run it: <?php class PHPExcel { private static function _interestAndPrincipal($rate=0, $per=0, $nper=0, $pv=0, $fv=0, $type=0) { $pmt = self::PMT($rate, $nper, $pv, $fv, $type); $capital = $pv; for ($i = 1; $i<= $per; ++$i) { $interest = ($type && $i == 1)? 0 : -$capital * $rate; $principal = $pmt - $interest; $capital += $principal; } return array($interest, $principal); } // public static function IPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0) { $rate = self::flattenSingleValue($rate); $per = (int) self::flattenSingleValue($per); $nper = (int) self::flattenSingleValue($nper); $pv = self::flattenSingleValue($pv); $fv = self::flattenSingleValue($fv); $type = (int) self::flattenSingleValue($type); // Validate parameters if ($type != 0 && $type != 1) { return self::$_errorCodes['num']; } if ($per <= 0 || $per > $nper) { return self::$_errorCodes['value']; } // Calculate $interestAndPrincipal = self::_interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type); return $interestAndPrincipal[0]; } // } $c = new PHPExcel; $c->IPMT(0.0538,1,360,1073000,0); ?> Is it that I'm just missing that function or is it something else? Thanks!!!!
  10. Hi, I'm working with a mortgage calculator and am desperately trying to figure out a Mortgage Interest Tax Deduction Formula. The client is using Excel's "IPMT()" function. Anyone out there know what the formula behind that function is? The formula I'm using currently (which produces different numbers than Excel's IPMT() function) is as follows: TheTaxDeduction = ((TotalMonthPay * AnnualInterestRate) * 12)*35% Any help will be greatly appreciated!
  11. Hello all, I'm currently using phpmailer and it's working fine besides the fact that the email gets sent to the bulk/spam folder. Is there a way around this? I have it set up so that when someone submits the form it sends them an html confirmation email. The problem is that if it's sent to their bulk folder then it's really of no use. Any help would be appreaciated
×
×
  • 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.