Questions tagged [buy.php]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
144 views
0
votes
1answer
34 views

Take input as number from a html input field

I want to take input as a number from an html field .I have declared the input type as number but when I click submit following screen shows up: I do not understand the error. How do I tackle it ?? ...
1
vote
1answer
99 views

pset7 (buy): trouble comparing value of transaction with cash

For some reason it is impossible for me to compare the cost of the buy-transaction with the user's cash balance in pset7. $value correctly comes up as a float, but $cash comes up as a string (even ...
0
votes
1answer
100 views

pset7 buy.php can't update number of shares

I get ( ! ) Fatal error: Duplicate entry 'ihor-BCE' for key 'user_id_2' in /home/ubuntu/workspace/pset7/vendor/library50-php-5/CS50/CS50.php on line 352 I thought that the supplied code was supposed ...
0
votes
1answer
791 views

pset7 problem with buy and portfolios table

Hello again! I have a problem concerning my buy.php code. The whole site is ready to launch but I keep having a problem with this particular bug, that I seem to fix every time but it keeps coming ...
0
votes
1answer
265 views

The code given in cs50 doesn t work

I have been working a long time in buy.php and everything works but if I buy the same stock (AAPL) twice it insert a new row into table despite they have de same id, and symbol. //...
1
vote
1answer
154 views

Constant database already defined

I'm trying to implement buy.php, and I'm getting this list of errors, constant database already defined, Constant password already defined, apologize already declared. I don't know why this is ...
0
votes
0answers
141 views

PHP data comparison for sell.php

when ever I try to use if($shares > $_POST["shares1"]) (where shares is equal to the shares you currently own and shares1 is how many additional shares you want to buy, with redirect() inside of it)...