0

I get a fatal error message saying unknown column 'cash' in the 'field list'.Now I checked pset7.sql and found that as the sql code in that file has no cash column ,so the users table hasn't got that column which in tern is giving that error. In my INSERT statement in register.php,if I write this:

         $result=CS50::query("INSERT IGNORE INTO users(username,hash) VALUES(?,?)",$_POST["username"],password_hash($_POST["password"],PASSWORD_DEFAULT));

instead of:

$result=CS50::query("INSERT IGNORE INTO users(username,hash,cash) VALUES(?,?,1000.000)",$_POST["username"],password_hash($_POST["password"],PASSWORD_DEFAULT));

I don't get any error and I am directed to index.php.So I want to know that will it be OK if I change pset7.sql,adding that additional column of cash in the sql statements and updating the users table or shall I write the insert statement omitting the cash field in register.php

0

Review the users section in spec/instructions for pset 7, specifically:

Assuming you’re still on phpMyAdmin’s Structure tab, you should see a form with which you can add new columns.

You must log in to answer this question.

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