php - Insert a customer borrowing a particular CD -
so, have question on whether sql statement inserting customer borrowing particular cd valid or not.
here's form want customer fill out.
<form action="proj3.php" method="post"> <h4>enter regular customer information.</h4> customer name: <input type="text" name="cust_name"><br> customer ssn: <input type="text" name="cust_ssn"> (no spaces or special characters)<br> customer telephone number: <input type="text" name="cust_tel"> (no spaces or special characters) <br> <h4>enter existing cd information.</h4> cd title: <input type="text" name="cd_title"><br> cd year: <input type="text" name="cd_year"><br> <h4>enter rent information.</h4> start cd rent date: <input type="text" name="rent_date"> (format: yyyy-mm-dd)<br> rent duration (days): <input type="text" name="rent_duration"><br> <input type="submit" name="submit" value="submit"> </form>
here's e-r diagram did:
now, backend database stuff i'm new , beginner to.
i want insert regular customer (non- vip) borrows/rents particular cd. how write sql statement that?
essentially, i'm confused on table , attributes should information go into? have 3 tables relate information. cd, rent , customer. insert statement writing?
i think may have assigning ids i'm not sure how yet. if there resources or tutorials should read, please feel free direct them me. i'm stuck right , want point in toward direction on steps take or here?
edit:
here's attempt:
$sql= "insert cd ( cd_title, cd_type, cd_year) values (‘$_post[title1]’, ‘$_post[type1]’, ‘$_post[year1]’)");
but take care of renting , customer aspect?
try read on basic sql stements. try come solution on own, , if stuck here sure help.
Comments
Post a Comment