PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 6th, 2002, 10:15 AM
mhoward mhoward is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 49 mhoward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
A Simple Math Function

or so I thought!

Can anyone tell the correct syntax for the following?
php Code:
Original - php Code
  1.  
  2. $row = mysql_fetch_row($check_result);
  3.            
  4.             $current_ticket_total = $row[11];
  5.  
  6.             $new_ticket_total = $confirm_tickets + $current_ticket_total;

Basically, the $confirm_tickets is generated from a form, then the email address is validated in the database, and the total number of tickets they have ordered previously, should be added to the $confirm_tickets and the row in the database updated.
However, the $confirm_tickets total is always used and replaces the $new_ticket_total in the database so both columns display the same!

Reply With Quote
  #2  
Old October 6th, 2002, 10:55 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: A Simple Math Function

Are you sure that $row[11] is where the current_ticket_total is stored? Remember that database fields start at 0, not 1. I would echo out $confirm_tickets and $current_ticket_total before adding them together to make sure they contain what you think they contain...

Reply With Quote
  #3  
Old October 7th, 2002, 12:53 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: A Simple Math Function

$row =Â*mysql_fetch_row($check_result);
$current_ticket_total =Â*$row[11];

You know that $row[11] would be referring to a column in the table that your fetching in $check_results.

Let me see $check_results -- it might help a little ;)

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > A Simple Math Function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway