Question: PHP/PDO HTML help For full context here is what I have to do. Given the tables created, (there will be images for them) I'm stuck
PHP/PDO HTML help
For full context here is what I have to do. Given the tables created, (there will be images for them) I'm stuck on step 3 here as I did try to make a proper form and submit the part. However, after submitting the part I'm looking for, no rows come up. I wish to know what I did wrong on step 3. I will share my current code below. 


FWI the S table means Supplier, the P means Part and SP (the 3rd table) means the supplier and part
1 There must be a way to show all of the suppliers and their details. (10 pts)
2 There must be a way to show all of the parts and their details. (10 pts)
3 There must be a form that allows a user to select a part and see everyone who supplies that part, along with how many of that part they have available. The information on the part chosen should be shown as well. (20 pts)
4 There must be a form that allows a user to select a supplier and get a list of all of the parts they supply and how many of each they have. Information on the supplier chosen should also be displayed. (15 pts)
5 There must be a way to select a part and a supplier and buy some number of parts from them, reducing the quantity they have left to supply by the amount bought. (Dont worry about tracking the purchases, just adjust the quantity appropriately.) (15 pts)
6 There must be a form that allows a user to add a new part to the database. (15 pts)
7 There must be a form that allows a user to add a new supplier to the database. (15 pts)
HERE"S MY CODE
setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); $rs=$pdo->query("SELECT * FROM S;"); $rows=$rs->fetchAll(PDO::FETCH_ASSOC); draw_table($rows); $rs=$pdo->query("SELECT * FROM P;"); $rows=$rs->fetchAll(PDO::FETCH_ASSOC); draw_table($rows); echo " "; echo " "; echo ""; } catch(PDOexception $e){ echo "Connection failed: " . $e->getMessage(); } ?>
S SNAME STATUS CITY 20 SI S2 S3 IO Smith Jones Blake Clark Adams London Paris Paris London Athens 30 20 S4 S5 30 COLOR WEIGHT I 2 PPNAME PI Nut P2 Bolt P3 Screw P4 Screw P5 Cam P6 Cog Red Green Blue Red Blue Red 17 17 14 12 19 SI P2 S P QTY PI 300 SI 200 SI P3 400 SI P4 200 SI P5 100 SI P6 100 S2 PI 300 S2 P2 400 S3 P2 200 P2 200 S4 P4 300 S4 P5 400 S4 S SNAME STATUS CITY 20 SI S2 S3 IO Smith Jones Blake Clark Adams London Paris Paris London Athens 30 20 S4 S5 30 COLOR WEIGHT I 2 PPNAME PI Nut P2 Bolt P3 Screw P4 Screw P5 Cam P6 Cog Red Green Blue Red Blue Red 17 17 14 12 19 SI P2 S P QTY PI 300 SI 200 SI P3 400 SI P4 200 SI P5 100 SI P6 100 S2 PI 300 S2 P2 400 S3 P2 200 P2 200 S4 P4 300 S4 P5 400 S4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
