You are here: Technology, Web & Business Forum
: Web Development
: Programming
:
help with arrays and inserting. thanks in adance!!!
|
Welcome to the Technology, Web & Business Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Programming Discuss programming languages such as .NET, PHP, PERL, ASP, ColdFusion, C++
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
|||
hello everyone - i am creating a phpsql stock market simulation game.
I have no obvious error but now something is obviously wrong with what is inserted- here are my last 3 purchases, the table from phpmyadmin is below. what i am trying to do is volume, which is the simply the sum of all values in the shares column. as of now i am just gettin a "0" when i purchase stock. here is what should be seen in the table results looking from phpmyadmin. id 105's volume should be 10 106's should be 20 and 107's should be 30 so on and so forth. to have a running total volume for this stock - in the end i would also like the price of the stock to change, based amount of buys or volume. im assuming price change would be this same theory. ![]() id symbol shares volume price increase 107 JAME 10 0 jimbo 500 106 JAME 10 0 jimbo 500 105 JAME 10 0 jimbo 500 53 JAME 0 50.00 0 i believe this is happening because of $volume, but i was assuming it would take its end result using this -----echo 'volume = '.$volume = $volume + $row['shares'] ; although could my problem also be how i am inserting into JAME_PH?? right now im trying to insert $volume. i think this is where im going wrong, did i leave anything in or out? thanks in advance here is my code------------ PHP Code:
|
|
|||
|
|||
you didn't give single quotes around volume while inserting to table, but i guess that's ok. What i think is you should see
PHP Code:
you forget the while loop PHP Code:
PHP Code:
|




Linear Mode
