pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Adding to multiplied values
4+ messages / 3 participants
[nested] [flat]

* Adding to multiplied values
@ 2006-05-19 04:45 Reed Loefgren <rloef@interfold.com>
  2006-05-19 07:09 ` Re: Adding to multiplied values Volkan YAZICI <yazicivo@ttnet.net.tr>
  0 siblings, 1 reply; 4+ messages in thread

From: Reed Loefgren @ 2006-05-19 04:45 UTC (permalink / raw)
  To: pgsql-php

All

I've been hacking away on a little time billing database and I've been having
difficulty adding to a calculated amount. This is what I am trying to get 
to in an insert (for the column 'grandTotal'):

($compRate * $time) + $expenses

I've tried various combinations of quotes, double quotes, parentheses and 
what have you, but I still get errors like:

ERROR:  operator is not unique: &quot;unknown&quot; + &quot;unknown&quot 
and
ERROR:  invalid input syntax for type numeric: &quot;7.50 * 5&quot

I've been able to figure out hours times comp to produce a subtotal, but I 
can't seem to pull in an additional amount to produce the grand total.

What's the syntax here?


thanks,

r



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Adding to multiplied values
  2006-05-19 04:45 Adding to multiplied values Reed Loefgren <rloef@interfold.com>
@ 2006-05-19 07:09 ` Volkan YAZICI <yazicivo@ttnet.net.tr>
  2006-05-19 13:13   ` Re: Adding to multiplied values Reed Loefgren <rloef@interfold.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Volkan YAZICI @ 2006-05-19 07:09 UTC (permalink / raw)
  To: Reed Loefgren <rloef@interfold.com>; +Cc: pgsql-php

On May 18 10:45, Reed Loefgren wrote:
> I've been hacking away on a little time billing database and I've been 
> having difficulty adding to a calculated amount.

Can we see the exact PHP code stands for the execution of related query?


Regards.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Adding to multiplied values
  2006-05-19 04:45 Adding to multiplied values Reed Loefgren <rloef@interfold.com>
  2006-05-19 07:09 ` Re: Adding to multiplied values Volkan YAZICI <yazicivo@ttnet.net.tr>
@ 2006-05-19 13:13   ` Reed Loefgren <rloef@interfold.com>
  2006-05-19 13:39     ` Re: Adding to multiplied values Randy Moller <zoomerz@comcast.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Reed Loefgren @ 2006-05-19 13:13 UTC (permalink / raw)
  To: Volkan YAZICI <yazicivo@ttnet.net.tr>; +Cc: pgsql-php

On Fri, 19 May 2006, Volkan YAZICI wrote:

> On May 18 10:45, Reed Loefgren wrote:
>> I've been hacking away on a little time billing database and I've been
>> having difficulty adding to a calculated amount.
>
> Can we see the exact PHP code stands for the execution of related query?
>
>
> Regards.
>
>

Sure, and thanks. This query works, but I fail at tying in $totalExpenses 
to create a $grandTotal. (pine is gonna butcher this...);

         $query = "INSERT INTO invoices2 (idate, iperiod, inum, ijobcode, 
iaccount, icomp, itime, isub, create_time) VALUES('" . $invoiceDate . "', 
'" . $billingPeriod . "', '" . $invoiceNumber . "', '" . $jobCode . "', '" 
. $accountNumber . "', '" . $billingRate . "', '" . $totalHours . "', '" . 
$billingRate * $totalHours . "', 'now()')";


r



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Adding to multiplied values
  2006-05-19 04:45 Adding to multiplied values Reed Loefgren <rloef@interfold.com>
  2006-05-19 07:09 ` Re: Adding to multiplied values Volkan YAZICI <yazicivo@ttnet.net.tr>
  2006-05-19 13:13   ` Re: Adding to multiplied values Reed Loefgren <rloef@interfold.com>
@ 2006-05-19 13:39     ` Randy Moller <zoomerz@comcast.net>
  0 siblings, 0 replies; 4+ messages in thread

From: Randy Moller @ 2006-05-19 13:39 UTC (permalink / raw)
  To: 'Reed Loefgren' <rloef@interfold.com>; 'Volkan YAZICI' <yazicivo@ttnet.net.tr>; +Cc: pgsql-php

Well, can we see the code that's failing? There's nothing we can tell you
about code that works.....(other than it would be a bit tidier not to do
your math inside a query....)

Z-

-----Original Message-----
From: pgsql-php-owner@postgresql.org [mailto:pgsql-php-owner@postgresql.org]
On Behalf Of Reed Loefgren
Sent: Friday, May 19, 2006 7:13 AM
To: Volkan YAZICI
Cc: PHP on postgresql list server
Subject: Re: [PHP] Adding to multiplied values

On Fri, 19 May 2006, Volkan YAZICI wrote:

> On May 18 10:45, Reed Loefgren wrote:
>> I've been hacking away on a little time billing database and I've been
>> having difficulty adding to a calculated amount.
>
> Can we see the exact PHP code stands for the execution of related query?
>
>
> Regards.
>
>

Sure, and thanks. This query works, but I fail at tying in $totalExpenses 
to create a $grandTotal. (pine is gonna butcher this...);

         $query = "INSERT INTO invoices2 (idate, iperiod, inum, ijobcode, 
iaccount, icomp, itime, isub, create_time) VALUES('" . $invoiceDate . "', 
'" . $billingPeriod . "', '" . $invoiceNumber . "', '" . $jobCode . "', '" 
. $accountNumber . "', '" . $billingRate . "', '" . $totalHours . "', '" . 
$billingRate * $totalHours . "', 'now()')";


r

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.6.0/342 - Release Date: 5/17/2006





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-05-19 13:39 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-19 04:45 Adding to multiplied values Reed Loefgren <rloef@interfold.com>
2006-05-19 07:09 ` Volkan YAZICI <yazicivo@ttnet.net.tr>
2006-05-19 13:13   ` Reed Loefgren <rloef@interfold.com>
2006-05-19 13:39     ` Randy Moller <zoomerz@comcast.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox