Create exUsingPostedInfo.php

Ok so i have been toying with the idea of creating a professor access element to the page, meaning a professor could log in and see the list of students that have enrolled in there class.  This is by no means compleate!!! and will not work on your databases unless you create the needed User table in your database.  If you guys like the idea i will update the tables file so that your databases can handel this code.  
what i would like to draw attention to is the first "if" statment after the //store student info in table comment.
in this section i am querying the stream_id value associated with the stream they selected from the login page. to do this i have to use the posted information (should the user be evil thay can see and alter posted information to a SQL statment that can distroy your database) so to prevent evil do-ers i used "prepare" and "bind".  the prepar statment sets the SQL code to be exicuted but " ? " is used where you would have just placed the value posted from the use entry on the login page.  The bind_param defines the posted value as a value and not code (there for the post it's self can not be exicuted just its value used as a search or entry value). in the bind statment the "s" value is a type in this case it means string (use "i" for integer and so on).  the fallowing line compleats the SQL statment with the binded value as the " ? ". the result is binded for storage in the var name in brackets and fetched. finally the statment is closed.

this process will ensure our database reamains intack!

for refrence the second "if" stores the posted values after binding into a new table i created call User, but it does show how to prepare and bind multiple posted variables. Moreover, the "else" just shows the error when trying to write to the database if it fails (like i said it took a bit to figure this all out and get it working)