Alexander Dahl avatar Alexander Dahl committed e40aec3 Draft

create sql and php files for chapter 9

Comments (0)

Files changed (4)

         </div>
         <div id="new">
             <h4>Add New Finisher</h4>
-            <form id="addRunner" name="addRunner" action="service.php" method="POST">
+            <form id="addRunner" name="addRunner" action="page343.php" method="POST">
                 First Name: <input type="text" name="txtFirstName" id="txtFirstName" /> <br />
                 Last Name: <input type="text" name="txtLastName" id="txtLastName" /> <br />
                 Gender: <select id="ddlGender" name="ddlGender">
+create database hfjq_race_info;
+
+CREATE USER 'runner_db_user'@'localhost' IDENTIFIED BY 'runner_db_password';
+GRANT SELECT,INSERT,UPDATE,DELETE ON hfjq_race_info.* TO 'runner_db_user'@'localhost';
+
+use hfjq_race_info;
+
+CREATE TABLE runners(
+    runner_id INT not null AUTO_INCREMENT,
+    first_name VARCHAR(100) not null,
+    last_name VARCHAR(100) not null,
+    gender VARCHAR(1) not null,
+    finish_time VARCHAR(10),
+    PRIMARY KEY (runner_id)
+);
+insert into runners (first_name, last_name, gender, finish_time) values ('John','Smith','m','25:31') ;
+insert into runners (first_name, last_name, gender, finish_time) values ('Jacob','Walker','m','25:54') ;
+insert into runners (first_name, last_name, gender, finish_time) values ('Mary','Brown','f','26:01') ;
+insert into runners (first_name, last_name, gender, finish_time) values ('Jenny','Pierce','f','26:04') ;
+insert into runners (first_name, last_name, gender, finish_time) values ('Frank','Jones','m','26:08') ;
+insert into runners (first_name, last_name, gender, finish_time) values ('Bob','Hope','m','26:38') ;
+insert into runners (first_name, last_name, gender, finish_time) values ('Jane','Smith','f','28:04') ;
+insert into runners (first_name, last_name, gender, finish_time) values ('Ryan','Rice','m','28:24') ;
+insert into runners (first_name, last_name, gender, finish_time) values ('Justin','Jones','m','29:14') ;
+<?php
+
+    mysql_connect('127.0.0.1', 'runner_db_user', 'runner_db_password')
+        OR die( 'Could not connect to database.');
+    mysql_select_db('hfjq_race_info');
+
+    echo "Connected!";
+
+?>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.