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 id = ?”, $_SESSION[“id”]);

The error is:

Syntax error, unexpected 'symbol' (T_STRING)

'symbol' definitely refers to the 'symbol' after select (I changed the name and the altered name appeared in the new error).

The line of code was taken almost directly from Zamyla's video on portfolio. I have also seen it in other people's code and they did not get the error I am getting.

1 Answer 1


There is no way anyone was going to get this with what I posted. I think the problem comes from the fact that I copy and pasted this from notes I was taking on Zamyla's video.

The key came when I realized the double-quote before SELECT was white but the one after the question mark was green. I have been fooling around with this for a while and I must have re-typed the last double quote.

For some reason, pasting the code into the IDE left me with white quotes(they are shaped differently than the green ones but only slightly).

Sorry for the distraction.

  • Glad you resolved this. (Those pesky curly quotes strike again!) Now, please click on the green check mark to accept your own answer. Otherwise, this will become a Zombie Question and forever haunt the forums.. Sep 10, 2016 at 21:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .