Presentation is loading. Please wait.

Presentation is loading. Please wait.

GUI To Create a DB Table CS346 Fall 2010 1. Methods to create a table At your local server and/or remote server – Use MySQL Console and create it interactively.

Similar presentations


Presentation on theme: "GUI To Create a DB Table CS346 Fall 2010 1. Methods to create a table At your local server and/or remote server – Use MySQL Console and create it interactively."— Presentation transcript:

1 GUI To Create a DB Table CS346 Fall 2010 1

2 Methods to create a table At your local server and/or remote server – Use MySQL Console and create it interactively – Use a batch SQL script Use HTML and PHP scripts with goals: – Let user interactively define the fields – Identical development environment on local and remote servers 2

3 Establish an identical environment Create a user on local server with the same and as your own on remote server (cs346) Create a database called See create_user_student.txt 3

4 Your Music collection Suppose you want to create a database table my_music with 8 attributes (columns) id format title fname of artist lname of artist rec_label my_notes date_acq 4

5 Interaction of 3 scripts 12-1show_createtable.html to prompt for – Name of table – Number of attributes (columns) – Then call 12-1show_fielddef.php 12-1do_show_fielddef.php – Display a form for user to specify field names, types, and length 12-1do_createtable.php – Do the actual create table 5

6 6 Before running the scripts, list the tables in the database student by running http://127.0.0.1/student/m11/11-3db_listtables.php http://127.0.0.1/student/m11/11-3db_listtables.php See the following slide

7 7

8 8

9 9

10 10 Check if the table my_music has been really created in the database student by running http://127.0.0.1/student/m11/11-3db_listtables.php Hmm! The message is not quite correct. Intention is to show that the table is being added to the database ‘student’. Correction: remove the quotes around “DB_NAME”. But at this point, I need to drop the table and create it again. Let us fix the script, upload it to cs346 latgerand test again.

11 11

12 12 Upload the m12 directory by Fillzilla to /var/www/students/student Then check the tables in the user student

13 13

14 14 Note we are now in the student account in cs346 server

15 15

16 16 Note: The message is corrected to show that the table is being added to the database ‘student’. My correction: remove the quotes around “DB_NAME”

17 17

18 18


Download ppt "GUI To Create a DB Table CS346 Fall 2010 1. Methods to create a table At your local server and/or remote server – Use MySQL Console and create it interactively."

Similar presentations


Ads by Google