Questions tagged [portfolio]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
3answers
704 views

Table layout portfolio

So I'm working on my portfolio, but I can't get my table nicely lined up. How can I fix this with my html/css/php code? (code down below) EDIT: Removed code
1
vote
1answer
308 views

Pset7 Can't Print How Much Cash a User has? [closed]

Earlier today, I was trying to print out how much cash a user has for portfolio.php. I kept on getting a bunch of errors. I changed my code many times, but could never get rid of the errors I was ...
1
vote
1answer
181 views

How to determine how much cash a user has in C$50 Finance's portfolio.php

I've read portfolio's specifications. However, I have a doubt regarding how to update a given users's balance. Suppose a user with an id '1' buys a stock whose symbol is 'A' for a price '$B'. Now ...
1
vote
1answer
737 views

Pset7 Table HTML and CSS formatting

I'm working on pset7 porfolio, and I am trying to neatly style the table that shows the owned stocks. I can't seem to figure out the formatting/ ordering of the styling. I looked at w3's css styling ...
1
vote
1answer
78 views

Pset7 - Portfolio: $positions not filling

Working within index.php, I feel like I understand the logic of what is going on, and I can get portfolio.php to render out fine on the website - with the exception that it only prints out one row ...
1
vote
1answer
181 views

Fatal error: Table 'pset7.portfolio' doesn't exist in /home/ubuntu/workspace/pset7/vendor/library50-php-5/CS50/CS50.php on line 352

I get the error in the title when working on portfolio of pset7. I went into a sql shell as described here and the table portfolio appears in the list - if it didn't appear in the list, I could have ...
1
vote
1answer
197 views

CS50 Finance: Index - list indices must be integers or slices, not str

I've been stuck on this for quite some time. I believe that I'm getting back data in the form of a dictionary but can't figure out how to get the information that I need. Error messages that have ...
1
vote
1answer
100 views

pset7 portfolio need help

Been stuck on this problem for the last few hours, in order to implement portfolio I started by practicing, the idea was to call skroob's column of symbol, lets say I manually added two symbols there ...
0
votes
2answers
87 views

Pset7 buy portfolio values are null

Pset7 buy. Debug is super clear but I still don’t understand why it doesn’t work: DEBUG:cs50:SELECT cash FROM users WHERE id = 1 DEBUG:cs50:INSERT INTO portfolio (stock, shares, balance) VALUES(NULL, ...
0
votes
1answer
32 views

Finance Portfolio (index) I can't go on. Need to take to HTML the actual price and total of stock

I am stopped at this part of Finance now. I can print at HTML the symbol and the sum of the shares... but I don't know how to take the iteration for each symbol to the HTML to know the actual price ...
0
votes
1answer
446 views

pset7 finance portfolio table won't update with buy function

Below is my code for buy. After I run flask and tried to make a purchase, the history table updated and cash deducted from users table. However, portfolio table is still empty. I am thinking the error ...
0
votes
1answer
129 views

pset7 buy function stopped working... not inserting to portfolio

My buy function was working when I tested it, buy yesterday, when I was testing my implementation of "index" it stopped. The "INSERT INTO portfolio" line is no longer executing properly, and I cannot ...
0
votes
1answer
253 views

Pset7: How to get "Bought!" Alert in /Index when re-directing from /Buy (I tried IF condition, but failed) [duplicate]

I can't figure out how to get the "Bought!" alert into the HTML template. Can someone help me out? On the left is the "Brought!" alert i want. On the right is an exhibition of my noob-ness. Here is ...
0
votes
1answer
34 views

PSET7: Extracting strings from queries with PHP

Not a bug, but wondering if someone can explain why this works... I'm attempting to display someone's name and cash position. In index, I query the tables for the relevant values. This returns an ...
0
votes
1answer
34 views

pset7 portfolio query error

I just set up my tables for the portfolio section of pset7. Next step is to query the tables but I get a weird error on the following line: $rows = query(“SELECT symbol, shares FROM portfolio WHERE ...
0
votes
1answer
295 views

pset7 portfolio

When I click "browse" my table of portfolio, there's a warning sign says This table does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available. here's ...
0
votes
0answers
16 views

Index route_TypeError: 'NoneType' object is not subscriptable

I tried to run the program and encountered this error: My code: @app.route("/") @login_required def index(): """Show portfolio of stocks""" # Selecting ...
0
votes
1answer
45 views

When I go to '/' page for Finance it only shows the cash I have available

I've been struggling for hours with trying to get the '/' page to display the current portfolio. It displays the remaining cash fine but nothing else. On phpliteadmin I can see that the table gets ...
0
votes
1answer
313 views

Pset7 Finance Buy Function Internal Server Error

When I try to insert the portfolio values into the SQL database I receive an internal server error, please can someone tell me what I'm doing wrong. if request.method == "POST": # ensure symbol ...
0
votes
1answer
41 views

My portfolio table aren't displaying

Can anyone tell me why all the index are undefined as I already rendered $positions who contain all of the index?
0
votes
0answers
35 views

PSET7 Why can I not select last-child of table?

I am styline portfolio in PSET7. I am trying to select the last row to make it a different background colour but I can't seem to select it? I have tried various different ways but none work. HTML &...
0
votes
1answer
188 views

could someone help me with Portfolios table?

hello guys. I am stuck on this table. Could anyone tell me what how to do this table the right way. I do not know what types should i use for every row
0
votes
0answers
250 views

Pset7 portfolio does not display on index.php

When I open my website and log in, the index.php page shows a table with headers, but no data, even though I think it should be showing the data according to my code. Index.php: <?php // ...
0
votes
1answer
110 views

pset7: portfolio table gives error

I'm following the instructions in pset7's page, and I have to give users free shares, by inserting a new table in portfolios. However, i get this error: #1062 - Duplicate entry '1' for key 'PRIMARY' ...
0
votes
1answer
90 views

For portfolio, only the first digit of a user's cash amount will display

Right now, everything except cash in my portfolio implementation seems to be working well. The cash value, however, seems to report only the first digit of a user's cash balance. (For example, a $10,...
0
votes
1answer
87 views

pset7 Portfolio: Blank page

After completing portfolio, page loads a black page. I'm king of lost when needs to display in HTML/PHP/CSS code. xyz_form is understood. See portfolio (view) code below. CSS format took from Google.
0
votes
1answer
315 views

can't log in with registered users

whenever i try to log in with registered users by writing their usernames and hash(password) in the log in form .I get a (invalid username or password ) message. should I implement (portfolio) to be ...
0
votes
1answer
179 views

Illegal String Offset for portfolio

I have finished my portfolio.php and index.php. However, when I try and load the page, I get the error: Illegal string offset 'symbol' in /home/jharvard/vhosts/pset7/templates/portfolio.php on line ...
-1
votes
1answer
182 views

What's wrong with my menu bar for portfolio.php

Basically I copied the CS50 style for the portfolio page of pset7. For the menu bar, I implemented the following: (this is at the top of my portfolio php code. After this, I display the table) <u1 ...