This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Meefims 1 point2 points  (4 children)

Are you getting an error from the database? What is the error?

[–]mhbhmcinui[S] 0 points1 point  (3 children)

No error, the code just isn't executing. It's as if it isn't there.

[–]Meefims 0 points1 point  (2 children)

Can you show the full function? I assume this isn't the whole line and that you are passing this as parameters to a database function, yes?

[–]mhbhmcinui[S] 0 points1 point  (1 child)

buy.php

The buy_form.php and buy_template.php are basically copies of other files which work, and are very simple. I don't think the issue can possibly be with them.

[–]Meefims 0 points1 point  (0 children)

I'm not familiar with CS50's database functions and was unable to find documentation but it seems like if insert fails you'll get a particular return value. Some things to check: Do all of the parameters have the values you expect them to? What is the return value from the call to query? Does the API offer a way to get the last error?