Create Basic Databases and Integrate with a Website Lesson 5

Size: px
Start display at page:

Download "Create Basic Databases and Integrate with a Website Lesson 5"

Transcription

1 Create Basic Databases and Integrate with a Website Lesson 5 Forum Project In this lesson we will be creating a simple discussion forum which will be running from your domain. If you wish you can develop it on your local computer using phpdev, but the intention is for this project to be running live. We will need to create the database tables, user input forms, and display of the results. When broken into pieces like this, such a task seems quite simple as indeed it is! The ultimate goal is to understand the concepts and relationships that go into making something like a discussion forum, not to create the world s most fully-functional system. You will see it is quite sparse, but it is definitely relational. To make this project work you will need to: Create the forum posts and topics tables Create a front end for creating and reading posts Create the scripts that pull it together Plan Your System Once again, before you start with any database project you need to stop and think of the elements you will need for your system. You will need: 1. A table to hold the forum topics 2. A table to hold the actual forum postings 3. A way for users to add or read the topics Think about the basic components of a forum: topics and posts. A forum, if properly used, should have several topics, and each of these topics will have one or more posts submitted by users. Knowing that, you should realise that the posts are tied to the topics through a key field. This key forms the relationship between the two tables. Now what about the requirements for the topics themselves? You will definitely need a field for the title, and subsequently you may want fields to hold the creation time and the identification of the user who created the topic. Similarly, think of the requirements for the posts you ll want to store the text of the post, the time it was created, and the person creating it. Most importantly, you need the key to tie the post to the topic. Create the Forum Topics Table To create your table, you can either use a script, login to MySQL locally as we have in previous lessons, or use the phpmyadmin interface. Once again I recommend you try using the phpmyadmin interface by opening a browser window and typing the address db.username.cessnock-ict.net. As you only have one database on your domain, to hold all your tables, then we should prefix the table names in a way that indicates which project the tables belongs too. So rather than just using topics as a name we ll use forum_topics. The SQL code would be: CREATE TABLE forum_topics ( topic_id int not null primary key auto_increment, topic_title varchar (150), topic_create_time datetime, topic_owner varchar (150) ); Go ahead and create the table in your existing (default) database. 1

2 Create the Forum Posts Table We ll name our table to hold the posts as forum_posts. The SQL code would be: CREATE TABLE forum_posts ( post_id int not null primary key auto_increment, topic_id int not null, post_text text, post_create_time datetime, post_owner varchar (150) ); Go ahead and create the table in your existing database. You should now have 2 empty tables, which can form a relationship like that indicated in the image above. The tables are now waiting for some input. We ll create the input forms for adding a topic and a post, but first we should consider reusability and manageability issues Segregate Your Code At this stage all your samples, tutorial examples and challenge tasks etc., are all stored in a single directory (folder) on the server. As a means to create a tidier and more manageable file system, it would be desirable to have separate folders for each project. Using Dreamweaver or an FTP application, create a folder on your server called Forum in which to store the entire Forum Project. Create the Forum folder in the PHP directory that we have been using since the beginning of this series of tutorials. So, the full path to your Forum would be: Modularise Your Code When planning and designing a project, think about clumping related function together into a single php file that can be included recall we referred to this as a library file. One good example would be for handling the database connectivity issues. We could create a single file called dbstuff.php that contains the connectivity variables and functions we need. This means we won t need to repeat any of our code elsewhere. For example, to open a connection to the database we could have a single opendb() function call; to close our connection we could have a single closedb() function call. It makes the whole coding process much simpler and less error-prone. Create the file from the following code (or you could copy it from your previous Mailing List project). <?php //Global variable declaration $host = 'db.username.cessnock-ict.net'; $username = 'username'; $password = 'student1'; $db = 'usernamedb'; 2

3 // opendb function will create a connection to our MySQL server, then select the database function opendb() { global $conn, $host, $username, $password, $db; $conn = mysql_connect($host, $username, $password) or die(mysql_error()); mysql_select_db($db, $conn) or die(mysql_error()); // closedb function is used to formally close our MySQL database connection function closedb(){ global $conn; mysql_close($conn);?> Save the code as dbstuff.php in the Forum directory. Create the Input Forms and Scripts Before you can add any posts, you must add a topic to the forum. It is common practice in forum creation to add the topic and add the first post in that topic at the same time. From a user s point of view, it doesn t make much sense to add a topic, and then go back, select the topic and add a reply. You want the process to be as smooth as possible. Create the code below to present the form to the user. <html> <head> <title>add a Topic</title> </head> <body> <h1>add a Topic</h1> <form method=post action="addtopic.php"> <p><strong>your Address:</strong><br> <input type="text" name="topicowner" size=40 maxlength=150></p> <p><strong>topic Title:</strong><br> <input type="text" name="topictitle" size=40 maxlength=150></p> <p><strong>post Text:</strong><br> <textarea name="posttext" rows=8 cols=40 wrap=virtual></textarea></p> <p><input type="submit" name="submit" value="add Topic"></p> </form> </body> </html> Save the code above as addtopic.html in your Forum folder. 3

4 The form seems simple enough three fields are all you need to complete both tables as your script will complete the rest. Create the Add Topic and Post Script To create the entry in the forum_topics table, you use the values from the $_POST[topicTitle] and $_POST[topicOwner] variables from the input form. The topic_id will be automatically incremented and topic_create_time fields added via the now() MySQL function. Similarly in the forum_posts table, you use the values of $_POST[postText] and $_POST[topicOwner] from the input form. The post_id will be automatically incremented and the post_create_time added the same as above. Because you need a topic_id to be able to complete the post entry in the forum_post table, you know the query must happen after the query to insert the record in the forum_topics table. It would also seem reasonable that we check to make sure that all three fields have some content, before attempting to go any further. Let s now create the script that adds an entry to both forum_topics and forum_posts. <?php //check for required fields from the form if ((!$_POST[topicOwner]) (!$_POST[topicTitle]) (!$_POST[postText])) { header("location: addtopic.html"); exit; include("dbstuff.php"); //connect to server and select database opendb(); //create and issue the first query $add_topic = "INSERT INTO forum_topics VALUES ('', '$_POST[topicTitle]', now(), '$_POST[topicOwner]')"; mysql_query($add_topic,$conn) or die(mysql_error()); //get the id of the last query $topic_id = mysql_insert_id(); 4

5 //create and issue the second query $add_post = "INSERT INTO forum_posts VALUES ('', '$topic_id', '$_POST[postText]', now(), '$_POST[topicOwner]')"; mysql_query($add_post,$conn) or die(mysql_error()); //create nice message for user $topictitle = $_POST[topicTitle]; $display_block = "<P>The <strong>$topictitle</strong> topic has been created.</p>";?> <html> <head> <title>new Topic Added</title> </head> <body> <h1>new Topic Added</h1> <?php echo $display_block;?> </body> </html> Save the code above as addtopic.php in the Forum folder. Test the Add Topic Mechanism Load the addtopic.html file from your server and make an entry like this example After submitting the topic, you should be presented with the output 5

6 Picking it to pieces Looking at some of the relevant lines of code we have: if ((!$_POST[topicOwner]) (!$_POST[topicTitle]) (!$_POST[postText])) { header("location: addtopic.html"); exit; The first thing that happens is that there is a test to ensure that there is content in the submitted variables and that the submission was from a POST. If any details are missing, or the script was not accessed through a post, then the user is presented with the form to complete. include("dbstuff.php"); opendb(); Include that database stuff that is required to connect to MySQl, and then actually open the database. $add_topic = "INSERT INTO forum_topics VALUES ('', '$_POST[topicTitle]', now(), '$_POST[topicOwner]')"; mysql_query($add_topic,$conn) or die(mysql_error()); Create the query string and execute the query. If the query fails then an error message is generated and the program will crash out (die). //get the id of the last query $topic_id = mysql_insert_id(); Now this piece of code is new and is a clever way of finding a specific piece of information from the previously run query just above i.e. the inserting of the forum_topics record. The MySQL manual describes the mysql_insert_id() function this way: mysql_insert_id() Returns the value generated for an AUTO_INCREMENT column by the previous INSERT or UPDATE statement. Use this function after you have performed an INSERT statement into a table that contains an AUTO_INCREMENT field. More precisely, mysql_insert_id() is updated under these conditions: INSERT statements that store a value into an AUTO_INCREMENT column. This is true whether the value is automatically generated by storing the special values NULL or 0 into the column, or is an explicit non-special value. In the case of a multiple-row INSERT statement, mysql_insert_id() returns the first automatically generated AUTO_INCREMENT value; if no such value is generated, it returns the last last explicit value inserted into the AUTO_INCREMENT column. INSERT statements that generate an AUTO_INCREMENT value by inserting LAST_INSERT_ID(expr) into any column. INSERT statements that generate an AUTO_INCREMENT value by updating any column to LAST_INSERT_ID(expr). The value of mysql_insert_id() is not affected by statements such as SELECT that return a result set. If the previous statement returned an error, the value of mysql_insert_id() is undefined. Note that mysql_insert_id() returns 0 if the previous statement does not use an AUTO_INCREMENT value. If you need to save the value for later, be sure to call mysql_insert_id() immediately after the statement that generates the value. 6

7 The value of mysql_insert_id() is affected only by statements issued within the current client connection. It is not affected by statements issued by other clients. So in essence, you don t have to issue a SELECT MAX(topic_id) FROM forum_topics query just to find out what the topic_id value should be. What a useful trick this is $add_post = "INSERT INTO forum_posts VALUES ('', '$topic_id', '$_POST[postText]', now(), '$_POST[topicOwner]')"; mysql_query($add_post,$conn) or die(mysql_error()); Here we issue the second INSERT query string, using the topic_id and the now() function. The now() function is used essentially the same as you would in other applications like Microsoft Excel. The function returns the current date and time. This is also a handy way of not needing to be concerned with formatting the date or time to suit MySQL. Another function worthy of remembering! The rest of the code is straightforward. Displaying the Topic List Now that you have a topic and at least one post in your database, you can display this information and let people add new topics or reply to existing ones. But before we go any further we should create a script that displays a list of all the topics in the forum. This page will show the basic information of each topic and provide the user with a link to add a new topic. There should be nothing in the code that you wouldn t have seen before except for some date formatting. <?php // connect to server and select database include("dbstuff.php"); opendb(); // gather the topics from the forum_topics table $get_topics = "SELECT topic_id, topic_title, topic_owner, date_format(topic_create_time,'%b %e %Y at %r') AS creation_time FROM forum_topics ORDER BY creation_time desc"; $get_topics_result = mysql_query($get_topics, $conn) or die(mysql_error()); if (mysql_num_rows($get_topics_result) < 1) { //there are no topics $display_block = "<p><em>no topics exist.</em></p>"; else { //create the display string containing the topic info $display_block = "<table cellpadding=3 cellspacing=1 border=1> <tr> <th>topic TITLE</th> <th># of POSTS</th> </tr>"; while ($topic_info = mysql_fetch_array($get_topics_result)) { $topic_id = $topic_info['topic_id']; $topic_title = stripslashes($topic_info['topic_title']); $topic_create_time = $topic_info['creation_time']; $topic_owner = stripslashes($topic_info['topic_owner']); //get number of posts that have been submitted for the current topic $get_num_posts = "SELECT COUNT(post_id) AS num_posts FROM forum_posts WHERE topic_id = $topic_id"; $get_num_posts_result = mysql_query($get_num_posts,$conn) or die(mysql_error()); 7

8 $post_count_info = mysql_fetch_array($get_num_posts_result); $num_posts = $post_count_info['num_posts']; //add to display $display_block.= " <tr> <td><a href=\"showtopic.php?topic_id=$topic_id\"> <strong>$topic_title</strong></a><br> Created on $topic_create_time by $topic_owner</td> <td align=center>$num_posts</td> </tr>"; //close up the table $display_block.= "</table>";?> <html> <head> <title>topics in My Forum</title> </head> <body> <h1>topics in My Forum</h1> <?php echo $display_block;?> <p>would you like to <a href="addtopic.html">add a topic</a>?</p> </body> </html> Save the code as topiclist.php and test it out. If you have only added one post, then the display should be similar to the image below. Most of the code in topiclist.php is very straightforward, but there are a few lines that could be explained. date_format(topic_create_time,'%b %e %Y at %r') AS creation_time The MySQL date_format() function reference provides the following information. DATE_FORMAT(date, format) Formats the date value according to the format string. The following specifiers may be used in the format string: Specifier Description %a Abbreviated weekday name (Sun..Sat) %b Abbreviated month name (Jan..Dec) %c Month, numeric (0..12) 8

9 %D Day of the month with English suffix (0th, 1st, 2nd, 3rd,...) %d Day of the month, numeric (00..31) %e Day of the month, numeric (0..31) %f Microseconds ( ) %H Hour (00..23) %h Hour (01..12) %I Hour (01..12) %i Minutes, numeric (00..59) %j Day of year ( ) %k Hour (0..23) %l Hour (1..12) %M Month name (January..December) %m Month, numeric (00..12) %p AM or PM %r Time, 12-hour (hh:mm:ss followed by AM or PM) %S Seconds (00..59) %s Seconds (00..59) %T Time, 24-hour (hh:mm:ss) %U Week (00..53), where Sunday is the first day of the week %u Week (00..53), where Monday is the first day of the week %V Week (01..53), where Sunday is the first day of the week; used with %X %v Week (01..53), where Monday is the first day of the week; used with %x %W Weekday name (Sunday..Saturday) %w Day of the week (0=Sunday..6=Saturday) %X %x Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V Year for the week, where Monday is the first day of the week, numeric, four digits; used with %v %Y Year, numeric, four digits %y Year, numeric (two digits) %% A literal % character All other characters are copied to the result without interpretation. Note that the % character is required before format specifier characters. Ranges for the month and day specifiers begin with zero due to the fact that MySQL allows the storing of incomplete dates such as ' '. Examples: SQL string: SELECT DATE_FORMAT(' :23:00', '%W %M %Y'); Output or Results: 'Saturday October 1997' SQL string: SELECT DATE_FORMAT(' :23:00', '%H:%i:%s'); Output or Results: '22:23:00' SQL string: SELECT DATE_FORMAT(' :23:00', 9

10 '%D %y %a %d %m %b %j'); Output or Results: '4th 97 Sat Oct 277' SQL string: SELECT DATE_FORMAT(' ', '%X %V'); Output or Results: ' ' So picking it to pieces we have a date provided with a format string of: '%b %e %Y at %r' which produces the output string: Oct at 01:15:18 AM Displaying the Posts in a Topic The next logical step is to be able to display the actual posts that have been submitted for each topic. The line of code that will trigger this action was <a href=\"showtopic.php?topic_id=$topic_id\"> which uses a link (so it will be a GET type of request) calling the showtopic.php script and passing the topic_id as part of the query string. The whole process hangs on getting the topic_id, as that is the foreign key in the forum_posts table, relating to the forum_topics. So it would be appropriate validation to first check that a valid topic_id has been passed to our showtopic.php script. If this script makes it past this point then we would extract the topic_title, then all the posts. Create the code below. <?php // check for required info from the query string if (!$_GET[topic_id]) { header("location: topiclist.php"); exit; // create the database connection include("dbstuff.php"); opendb(); // verify the topic exists $get_topic_query = "SELECT topic_title FROM forum_topics WHERE topic_id = $_GET[topic_id]"; $get_topic_result = mysql_query($get_topic_query, $conn) or die(mysql_error()); // there should be at least 1 topic_title in our database, if not then there is an error if (mysql_num_rows($get_topic_result) < 1) { // this topic does not exist - generate a suitable error message $display_block = "<p><em>you have selected an invalid topic. Please <a href=\"topiclist.php\">try again</a>.</em></p>"; else { // get the topic title from the query taking only the first row $topic_title = stripslashes(mysql_result($get_topic_result, 0, 'topic_title')); // get all the posts for this topic $get_posts_query = "SELECT post_id, post_text, post_owner, date_format(post_create_time, '%b %e %Y at %r') AS creation_time FROM forum_posts WHERE topic_id = $_GET[topic_id] ORDER BY post_create_time ASC"; 10

11 $get_posts_results = mysql_query($get_posts_query,$conn) or die(mysql_error()); // create the display string $display_block = " <p>showing posts for the <strong>$topic_title</strong> topic:</p> <table width=100% cellpadding=3 cellspacing=1 border=1> <tr> <th>author</th> <th>post</th> </tr>"; // for each posting, create a table row and included the contents of the post while ($posts_info = mysql_fetch_array($get_posts_results)) { $post_id = $posts_info['post_id']; $post_text = nl2br(stripslashes($posts_info['post_text'])); $post_create_time = $posts_info['creation_time']; $post_owner = stripslashes($posts_info['post_owner']); //add to display $display_block.= " <tr> <td width=35% valign=top>$post_owner<br>[$post_create_time]</td> <td width=65% valign=top>$post_text<br><br> <a href=\"replytopost.php?post_id=$post_id\"> <strong>reply TO POST</strong> </a></td> </tr>"; //close up the table $display_block.= "</table>";?> <html> <head> <title>posts in Topic</title> </head> <body> <h1>posts in Topic</h1> <?php echo $display_block;?> </body> </html> Save the code above as showtopic.php and test it. The output from the first post would look similar to this: 11

12 If there are more postings then, they should also be listed. Picking it to Pieces Most of the code above should look familiar except for a couple of new functions. $topic_title = stripslashes( mysql_result($get_topic_result, 0, 'topic_title') ); Here is a slightly different method of extracting a record (array) from the results returned from executing a MySQL query. Till now the method I have been using is to extract a single row from the results, then each part or field of the row (remember the row is an array in itself). The command we have been using is mysql_fetch_array(). Now it is possible (though unlikely) that when executing the mysql query to get the topic_title that more than a single row might be returned. To make the extraction of the topic_title field from the first record (row) only, we can be specific. Using the mysql_result( ) function you can extract a specific piece of information, provided you know exactly where to locate it, with less code. Less code means less typing When you have multiple records returned as part of a query you essentially have a two-dimensional array. An individual record is an array, where the fields can be accessed via a subscript (index) or by name (associative array). For instance we could use $post_info[0] or $post_info[ post_id ]. When we issue the function call mysql_fetch_array() we get one single record. But the overall results are stored as an array of records, or basically an array of arrays. The easiest way to visualise it is to think of a spreadsheet with each record having a row number except the rows start counting from zero. $post_text = nl2br(stripslashes($posts_info['post_text'])); The nl2br( ) function is a handy way of inserting HTML breaks before any new line characters found in the string. Adding Posts to a Topic The only step missing in our forum is the ability to reply to a post. After all how can you get a good argument going if only one person has a say The script will be called replytopost.php and doesn t hold any real secrets or difficulties. Well no more than has been thrown at you so far at least Well actually there might be something of interest. Create the code below <?php // add the database connection ability include("dbstuff.php"); // check to see if we're showing the form or adding the post if ($_POST[op]!= "addpost") { // showing the form, but now check for required item in query string if (!$_GET[post_id]) { header("location: topiclist.php"); exit; $verify_query = "SELECT forum_topics.topic_id, forum_topics.topic_title FROM forum_topics, forum_posts WHERE forum_posts.topic_id = forum_topics.topic_id AND forum_posts.post_id = $_GET[post_id]"; // create the database connection opendb(); 12

13 $verify_result = mysql_query($verify_query, $conn) or die(mysql_error()); if (mysql_num_rows($verify_result) < 1) { // this post or topic does not exist header("location: topiclist.php"); exit; else { // get the topic id and title $topic_id = mysql_result($verify_result,0,'topic_id'); $topic_title = stripslashes(mysql_result($verify_result, 0,'topic_title')); echo " <html><head> <title>post Your Reply in $topic_title</title> </head> <body> <h1>post Your Reply in $topic_title</h1> <form method=post action=\"$_server[php_self]\"> <p><strong>your Address:</strong><br> <input type=\"text\" name=\"post_owner\" size=40 maxlength=150> <p><strong>post Text:</strong><br> <textarea name=\"post_text\" rows=8 cols=40 wrap=virtual></textarea> <input type=\"hidden\" name=\"op\" value=\"addpost\"> <input type=\"hidden\" name=\"topic_id\" value=\"$topic_id\"> <p><input type=\"submit\" name=\"submit\" value=\"add Post\"></p> </form> </body> </html>"; else if ($_POST[op] == "addpost") { //check for required items from the form if ((!$_POST[topic_id]) (!$_POST[post_text]) (!$_POST[post_owner])) { header("location: topiclist.php"); exit; // create the database connection and add the new posting opendb(); $posttext = addslashes($_post[post_text]); $add_post = "INSERT INTO forum_posts VALUES ('', '$_POST[topic_id]', '$posttext', now(), '$_POST[post_owner]')"; mysql_query($add_post, $conn) or die(mysql_error()); closedb();?> //redirect user to topic header("location: showtopic.php?topic_id=$topic_id"); exit; Save the code above as replytopost.php and test it out. An example reply might look similar to the one below. 13

14 After adding the post above you should be returned to the list of posts for the current topic. The Query String in Different Ways Our forum database has two tables which can be related through the topic_id field. The query string that we used in the replytopost.php script, could be considered as not the done way for a proper relational query. The Query we used was: SELECT forum_topics.topic_id, forum_topics.topic_title FROM forum_topics, forum_posts WHERE forum_posts.topic_id = forum_topics.topic_id AND forum_posts.post_id = $_GET[post_id] However, if we were to write the statement using more precise relational techniques, the query might be written: SELECT ft.topic_id, ft.topic_title FROM forum_posts AS fp LEFT JOIN forum_topics AS ft ON fp.topic_id = ft.topic_id WHERE fp.post_id = $_GET[post_id]"; A LEFT JOIN is where all the entries for the table on the left are shown (so all the forum_posts will be in the query) and only those entries in the right table (forum_topics) are shown. The first example is the same as using an INNER JOIN. The important point I would put forward is as long as you get the correct results, that s all that matters (conditional: limited to this set of learning outcomes). You should be able to replace the first SELECT statement with the second and still obtain the same results. 14

15 Exercises Challenge 1 15

Create Basic Databases and Integrate with a Website Lesson 3

Create Basic Databases and Integrate with a Website Lesson 3 Create Basic Databases and Integrate with a Website Lesson 3 Combining PHP and MySQL This lesson presumes you have covered the basics of PHP as well as working with MySQL. Now you re ready to make the

More information

COM1004 Web and Internet Technology

COM1004 Web and Internet Technology COM1004 Web and Internet Technology When a user submits a web form, how do we save the information to a database? How do we retrieve that data later? ID NAME EMAIL MESSAGE TIMESTAMP 1 Mike mike@dcs Hi

More information

COMS 469: Interactive Media II

COMS 469: Interactive Media II COMS 469: Interactive Media II Agenda Review Content Management (cont.) Replace all txt files with database tables Expand PHP/MySQL SELECT, UPDATE & DELETE queries Permit full editorial control over content

More information

ABSOLUTE FORM PROCESSOR ADMINISTRATION OPTIONS

ABSOLUTE FORM PROCESSOR ADMINISTRATION OPTIONS ABSOLUTE FORM PROCESSOR ADMINISTRATION OPTIONS The Absolute Form Processor is very easy to use. In order to operate the system, you just need the menu at the top of the screen. There, you ll find all the

More information

Adding A PHP+MySQL Hit Counter to your Website

Adding A PHP+MySQL Hit Counter to your Website Adding A PHP+MySQL Hit Counter to your Website Setting up MySQL First off, decide what you want to keep track of. In this case, let s commit to tracking total number of hits on each of a number of web

More information

Database Systems. phpmyadmin Tutorial

Database Systems. phpmyadmin Tutorial phpmyadmin Tutorial Please begin by logging into your Student Webspace. You will access the Student Webspace by logging into the Campus Common site. Go to the bottom of the page and click on the Go button

More information

Chapter 3. Introduction to relational databases and MySQL. 2010, Mike Murach & Associates, Inc. Murach's PHP and MySQL, C3

Chapter 3. Introduction to relational databases and MySQL. 2010, Mike Murach & Associates, Inc. Murach's PHP and MySQL, C3 1 Chapter 3 Introduction to relational databases and MySQL Slide 2 Objectives Applied 1. Use phpmyadmin to review the data and structure of the tables in a database, to import and run SQL scripts that

More information

Mount Saint Mary College, Newburgh, NY Internet Programming III - CIT310

Mount Saint Mary College, Newburgh, NY Internet Programming III - CIT310 Warm up mini-lab Lab 1 - Functions Type in the following function definition and calls to the function. Test it and understand it. function myprint($str= No String Supplied ) // the argument is optional

More information

Creating A Simple Calendar in PHP

Creating A Simple Calendar in PHP Creating A Simple Calendar in PHP By In this tutorial, we re going to look at creating calendars in PHP. In this first part of the series we build a simple calendar for display purposes, looking at the

More information

Lab 7 Introduction to MySQL

Lab 7 Introduction to MySQL Lab 7 Introduction to MySQL Objectives: During this lab session, you will - Learn how to access the MySQL Server - Get hand-on experience on data manipulation and some PHP-to-MySQL technique that is often

More information

Reference: W3School -

Reference: W3School - Language SQL SQL Adv Reference: W3School - http://www.w3schools.com/sql/default.asp http://www.tomjewett.com/dbdesign/dbdesign.php?page=recursive.php SQL Aliases SQL aliases are used to give a table, or

More information

Using htmlarea & a Database to Maintain Content on a Website

Using htmlarea & a Database to Maintain Content on a Website Using htmlarea & a Database to Maintain Content on a Website by Peter Lavin December 30, 2003 Overview If you wish to develop a website that others can contribute to one option is to have text files sent

More information

Database Manual Suite Version 2.8. Page 1 of 82. Noventri Suite Database Manual SF REV 03 3/21/14

Database Manual Suite Version 2.8. Page 1 of 82. Noventri Suite Database Manual SF REV 03 3/21/14 Database Manual Suite Version 2.8 Page 1 of 82 Database Manual Table of Contents 1 Overview... 4 2 Database Image/Text General... 5 3 Data Text... 8 4 ODBC... 12 4.4 ODBC Connect... 13 4.4.1 General...

More information

PHP Tutorial 6(a) Using PHP with MySQL

PHP Tutorial 6(a) Using PHP with MySQL Objectives After completing this tutorial, the student should have learned; The basic in calling MySQL from PHP How to display data from MySQL using PHP How to insert data into MySQL using PHP Faculty

More information

Lab 4: Basic PHP Tutorial, Part 2

Lab 4: Basic PHP Tutorial, Part 2 Lab 4: Basic PHP Tutorial, Part 2 This lab activity provides a continued overview of the basic building blocks of the PHP server-side scripting language. Once again, your task is to thoroughly study the

More information

Introduction to relational databases and MySQL

Introduction to relational databases and MySQL Chapter 3 Introduction to relational databases and MySQL A products table Columns 2017, Mike Murach & Associates, Inc. C3, Slide 1 2017, Mike Murach & Associates, Inc. C3, Slide 4 Objectives Applied 1.

More information

The connection has timed out

The connection has timed out 1 of 7 2/17/2018, 7:46 AM Mukesh Chapagain Blog PHP Magento jquery SQL Wordpress Joomla Programming & Tutorial HOME ABOUT CONTACT ADVERTISE ARCHIVES CATEGORIES MAGENTO Home» PHP PHP: CRUD (Add, Edit, Delete,

More information

Developing Ajax Applications using EWD and Python. Tutorial: Part 2

Developing Ajax Applications using EWD and Python. Tutorial: Part 2 Developing Ajax Applications using EWD and Python Tutorial: Part 2 Chapter 1: A Logon Form Introduction This second part of our tutorial on developing Ajax applications using EWD and Python will carry

More information

By the end of this section of the practical, the students should be able to:

By the end of this section of the practical, the students should be able to: By the end of this section of the practical, the students should be able to: Connecting to a MySQL database in PHP with the mysql_connect() and mysql_select_db() functions Trapping and displaying database

More information

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL.

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL. Hello everyone! Welcome to our PHP + MySQL (Easy to learn) E.T.L. free online course Hope you have installed your XAMPP? And you have created your forms inside the studio file in the htdocs folder using

More information

PHPRad. PHPRad At a Glance. This tutorial will show you basic functionalities in PHPRad and

PHPRad. PHPRad At a Glance. This tutorial will show you basic functionalities in PHPRad and PHPRad PHPRad At a Glance. This tutorial will show you basic functionalities in PHPRad and Getting Started Creating New Project To create new Project. Just click on the button. Fill In Project properties

More information

the Data Drive IN THIS CHAPTER Good Things Come in Free Packages

the Data Drive IN THIS CHAPTER Good Things Come in Free Packages c h a p t e r 7 Let the Data Drive IN THIS CHAPTER Good Things Come in Free Packages New Functions Installing MySQL Setting up a Simple Database Basic SQL Queries Putting Content into a Database Using

More information

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client Lab 2.0 - MySQL CISC3140, Fall 2011 DUE: Oct. 6th (Part 1 only) Part 1 1. Getting started This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client host

More information

CICS 515 b Internet Programming Week 2. Mike Feeley

CICS 515 b Internet Programming Week 2. Mike Feeley CICS 515 b Internet Programming Week 2 Mike Feeley 1 Software infrastructure stuff MySQL and PHP store files in public_html run on remote.mss.icics.ubc.ca access as http://ws.mss.icics.ubc.ca/~username/...

More information

A QUICK GUIDE TO PROGRAMMING FOR THE WEB. ssh (then type your UBIT password when prompted)

A QUICK GUIDE TO PROGRAMMING FOR THE WEB. ssh (then type your UBIT password when prompted) A QUICK GUIDE TO PROGRAMMING FOR THE WEB TO GET ACCESS TO THE SERVER: ssh Secure- Shell. A command- line program that allows you to log in to a server and access your files there as you would on your own

More information

PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008.

PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008. PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008. Outline. How cookies work. Cookies in PHP. Sessions. Databases. Cookies. Sometimes it is useful to remember a client when it comes

More information

Introduction. Why Would I Want A Database?

Introduction. Why Would I Want A Database? Introduction For many people, the main reason for learning a scripting language like PHP is because of the interaction with databases it can offer. In this tutorial I will show you how to use PHP and the

More information

School of Information and Computer Technology Sirindhorn International Institute of Technology Thammasat University

School of Information and Computer Technology Sirindhorn International Institute of Technology Thammasat University School of Information and Computer Technology Sirindhorn International Institute of Technology Thammasat University ITS351 Database Programming Laboratory Laboratory #9: PHP & Form Processing III Objective:

More information

SQL. Often times, in order for us to build the most functional website we can, we depend on a database to store information.

SQL. Often times, in order for us to build the most functional website we can, we depend on a database to store information. Often times, in order for us to build the most functional website we can, we depend on a database to store information. If you ve ever used Microsoft Excel or Google Spreadsheets (among others), odds are

More information

ITS331 IT Laboratory I: (Laboratory #11) Session Handling

ITS331 IT Laboratory I: (Laboratory #11) Session Handling School of Information and Computer Technology Sirindhorn International Institute of Technology Thammasat University ITS331 Information Technology Laboratory I Laboratory #11: Session Handling Creating

More information

Installing Dolphin on Your PC

Installing Dolphin on Your PC Installing Dolphin on Your PC Note: When installing Dolphin as a test platform on the PC there are a few things you can overlook. Thus, this installation guide won t help you with installing Dolphin on

More information

What is SQL? Toolkit for this guide. Learning SQL Using phpmyadmin

What is SQL? Toolkit for this guide. Learning SQL Using phpmyadmin http://www.php-editors.com/articles/sql_phpmyadmin.php 1 of 8 Members Login User Name: Article: Learning SQL using phpmyadmin Password: Remember Me? register now! Main Menu PHP Tools PHP Help Request PHP

More information

Lecture 6: More Arrays & HTML Forms. CS 383 Web Development II Monday, February 12, 2018

Lecture 6: More Arrays & HTML Forms. CS 383 Web Development II Monday, February 12, 2018 Lecture 6: More Arrays & HTML Forms CS 383 Web Development II Monday, February 12, 2018 Lambdas You may have encountered a lambda (sometimes called anonymous functions) in other programming languages The

More information

COMP519: Web Programming Autumn 2015

COMP519: Web Programming Autumn 2015 COMP519: Web Programming Autumn 2015 In the next lectures you will learn What is SQL How to access mysql database How to create a basic mysql database How to use some basic queries How to use PHP and mysql

More information

If Only. More SQL and PHP

If Only. More SQL and PHP If Only More SQL and PHP PHP: The if construct If only I could conditionally select PHP statements to execute. That way, I could have certain actions happen only under certain circumstances The if statement

More information

Troubleshooting An Embedded Sametime Install by Julian Robichaux, panagenda originally published on socialbizug.org, November 2013

Troubleshooting An Embedded Sametime Install by Julian Robichaux, panagenda originally published on socialbizug.org, November 2013 Troubleshooting An Embedded Sametime Install by Julian Robichaux, panagenda originally published on socialbizug.org, November 2013 I was testing the new IBM Sametime 9 client on a few different virtual

More information

CS 2316 Homework 9a Login Due: Friday, November 2nd, before 11:55 PM Out of 100 points. Premise

CS 2316 Homework 9a Login Due: Friday, November 2nd, before 11:55 PM Out of 100 points. Premise CS 2316 Homework 9a Login Due: Friday, November 2nd, before 11:55 PM Out of 100 points Files to submit: 1. HW9.py This is an INDIVIDUAL assignment! Collaboration at a reasonable level will not result in

More information

Café Soylent Green Chapter 12

Café Soylent Green Chapter 12 Café Soylent Green Chapter 12 This version is for those students who are using Dreamweaver CS6. You will be completing the Forms Tutorial from your textbook, Chapter 12 however, you will be skipping quite

More information

Mysql Tutorial Show Table Like Name Not >>>CLICK HERE<<<

Mysql Tutorial Show Table Like Name Not >>>CLICK HERE<<< Mysql Tutorial Show Table Like Name Not SHOW TABLES LIKE '%shop%' And the command above is not working as Table name and next SHOW CREATE TABLEcommand user889349 Apr 18. If you do not want to see entire

More information

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data CS 418/518 Web Programming Spring 2014 HTML Tables and Forms Dr. Michele Weigle http://www.cs.odu.edu/~mweigle/cs418-s14/ Outline! Assigned Reading! Chapter 4 "Using Tables to Display Data"! Chapter 5

More information

Advanced Web Tutorial 10

Advanced Web Tutorial 10 Advanced Web Tutorial 10 Editor Brackets / Visual Studio Code Goals Creating a blog with PHP and MySql. - Set up and configuration of Xampp - Learning Data flow using Create/Read/Update and Delete Things

More information

Writing Perl Programs using Control Structures Worked Examples

Writing Perl Programs using Control Structures Worked Examples Writing Perl Programs using Control Structures Worked Examples Louise Dennis October 27, 2004 These notes describe my attempts to do some Perl programming exercises using control structures and HTML Forms.

More information

A Primer in Web Application Development

A Primer in Web Application Development A Primer in Web Application Development The purpose of this primer is to provide you with some concept of how web applications work. You will look at some database information, some application development

More information

CS50 Quiz Review. November 13, 2017

CS50 Quiz Review. November 13, 2017 CS50 Quiz Review November 13, 2017 Info http://docs.cs50.net/2017/fall/quiz/about.html 48-hour window in which to take the quiz. You should require much less than that; expect an appropriately-scaled down

More information

Using PHP with MYSQL

Using PHP with MYSQL Using PHP with MYSQL PHP & MYSQL So far you've learned the theory behind relational databases and worked directly with MySQL through the mysql command-line tool. Now it's time to get your PHP scripts talking

More information

WHAT IS A DATABASE? There are at least six commonly known database types: flat, hierarchical, network, relational, dimensional, and object.

WHAT IS A DATABASE? There are at least six commonly known database types: flat, hierarchical, network, relational, dimensional, and object. 1 WHAT IS A DATABASE? A database is any organized collection of data that fulfills some purpose. As weather researchers, you will often have to access and evaluate large amounts of weather data, and this

More information

Stored procedures - what is it?

Stored procedures - what is it? For a long time to suffer with this issue. Literature on the Internet a lot. I had to ask around at different forums, deeper digging in the manual and explain to himself some weird moments. So, short of

More information

How to add (simple) interactivity to Madagascar: A proposal. Joe Dellinger, BP

How to add (simple) interactivity to Madagascar: A proposal. Joe Dellinger, BP How to add (simple) interactivity to Madagascar: A proposal Joe Dellinger, BP What do I mean by interactive? If you want to do REAL interactive graphics, you probably need to create your masterpiece! I

More information

Using MySQL on the Winthrop Linux Systems

Using MySQL on the Winthrop Linux Systems Using MySQL on the Winthrop Linux Systems by Dr. Kent Foster adapted for CSCI 297 Scripting Languages by Dr. Dannelly updated March 2017 I. Creating your MySQL password: Your mysql account username has

More information

Database Connectivity using PHP Some Points to Remember:

Database Connectivity using PHP Some Points to Remember: Database Connectivity using PHP Some Points to Remember: 1. PHP has a boolean datatype which can have 2 values: true or false. However, in PHP, the number 0 (zero) is also considered as equivalent to False.

More information

BF Survey Pro User Guide

BF Survey Pro User Guide BF Survey Pro User Guide January 2011 v1.0 1 of 41 www.tamlyncreative.com.au/software/ Table of Contents Introduction... 5 Support... 5 Documentation... 5 Installation New Install... 5 Installation Upgrade...

More information

Week - 01 Lecture - 04 Downloading and installing Python

Week - 01 Lecture - 04 Downloading and installing Python Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and

More information

Chapter 3 Introduction to relational databases and MySQL

Chapter 3 Introduction to relational databases and MySQL Chapter 3 Introduction to relational databases and MySQL Murach's PHP and MySQL, C3 2014, Mike Murach & Associates, Inc. Slide 1 Objectives Applied 1. Use phpmyadmin to review the data and structure of

More information

Yii User Identity Error Code 100

Yii User Identity Error Code 100 Yii User Identity Error Code 100 It's 100% free, no registration required. In the login page, after submit the form, it displays the following error $model-_attributes=$_post('loginform'), // validate

More information

Build a Professional Website Using Joomla 1.5

Build a Professional Website Using Joomla 1.5 Build a Professional Website Using Joomla 1.5 Part IV: Creating a Joomla Component This article is part of the series on Joomla. In Part 1, we learned the basics of Joomla, using it to create a professional

More information

Host at 2freehosting.Com

Host at 2freehosting.Com Host at 2freehosting.Com This document will help you to upload your website to a free website hosting account at www.2freehosting.com/. Follow all the steps carefully in the order that they appear to ensure

More information

MySQL: an application

MySQL: an application Data Types and other stuff you should know in order to amaze and dazzle your friends at parties after you finally give up that dream of being a magician and stop making ridiculous balloon animals and begin

More information

Server Side Scripting Report

Server Side Scripting Report Server Side Scripting Report David Nelson 205CDE Developing the Modern Web Assignment 2 Student ID: 3622926 Computing BSc 29 th March, 2013 http://creative.coventry.ac.uk/~nelsond/ - Page 1 - Contents

More information

Course Topics. IT360: Applied Database Systems. Introduction to PHP

Course Topics. IT360: Applied Database Systems. Introduction to PHP IT360: Applied Database Systems Introduction to PHP Chapter 1 and Chapter 6 in "PHP and MySQL Web Development" Course Topics Relational model SQL Database design Normalization PHP MySQL Database administration

More information

c360 Web Connect Configuration Guide Microsoft Dynamics CRM 2011 compatible c360 Solutions, Inc. c360 Solutions

c360 Web Connect Configuration Guide Microsoft Dynamics CRM 2011 compatible c360 Solutions, Inc.   c360 Solutions c360 Web Connect Configuration Guide Microsoft Dynamics CRM 2011 compatible c360 Solutions, Inc. www.c360.com c360 Solutions Contents Overview... 3 Web Connect Configuration... 4 Implementing Web Connect...

More information

CS 2316 Homework 9b GT Thrift Shop Due: Wednesday, April 20 th, before 11:55 PM Out of 100 points. Premise

CS 2316 Homework 9b GT Thrift Shop Due: Wednesday, April 20 th, before 11:55 PM Out of 100 points. Premise CS 2316 Homework 9b GT Thrift Shop Due: Wednesday, April 20 th, before 11:55 PM Out of 100 points Files to submit: 1. HW9b.py 2. any image files (.gif ) used in database This is an INDIVIDUAL assignment!

More information

Executing Simple Queries

Executing Simple Queries Script 8.3 The registration script adds a record to the database by running an INSERT query. 1

More information

<Insert Picture Here> New MySQL Enterprise Backup 4.1: Better Very Large Database Backup & Recovery and More!

<Insert Picture Here> New MySQL Enterprise Backup 4.1: Better Very Large Database Backup & Recovery and More! New MySQL Enterprise Backup 4.1: Better Very Large Database Backup & Recovery and More! Mike Frank MySQL Product Management - Director The following is intended to outline our general

More information

Chapter 8 Relational Tables in Microsoft Access

Chapter 8 Relational Tables in Microsoft Access Chapter 8 Relational Tables in Microsoft Access Objectives This chapter continues exploration of Microsoft Access. You will learn how to use data from multiple tables and queries by defining how to join

More information

Relational databases and SQL

Relational databases and SQL Relational databases and SQL Relational Database Management Systems Most serious data storage is in RDBMS Oracle, MySQL, SQL Server, PostgreSQL Why so popular? Based on strong theory, well-understood performance

More information

PHP Development - Introduction

PHP Development - Introduction PHP Development - Introduction Php Hypertext Processor PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports many

More information

CSc 337 Final Examination December 13, 2013

CSc 337 Final Examination December 13, 2013 On my left is: (NetID) MY NetID On my right is: (NetID) CSc 337 Final Examination December 13, 2013 READ THIS FIRST Read this page now but do not turn this page until you are told to do so. Go ahead and

More information

Mehran Sahami Handout #7 CS 106A September 24, 2014

Mehran Sahami Handout #7 CS 106A September 24, 2014 Mehran Sahami Handout #7 CS 06A September, 0 Assignment #: Email/Survey and Karel the Robot Karel problems due: :pm on Friday, October rd Email and online survey due: :9pm on Sunday, October th Part I

More information

week8 Tommy MacWilliam week8 October 31, 2011

week8 Tommy MacWilliam week8 October 31, 2011 tmacwilliam@cs50.net October 31, 2011 Announcements pset5: returned final project pre-proposals due Monday 11/7 http://cs50.net/projects/project.pdf CS50 seminars: http://wiki.cs50.net/seminars Today common

More information

Tutorial letter 103/2/2018

Tutorial letter 103/2/2018 ICT2613/103/1/2018 Tutorial letter 103/2/2018 Internet Programming ICT2613 Semester 1 School of Computing IMPORTANT INFORMATION: This tutorial letter contains information about Assignment 2 1. INTRODUCTION

More information

Development Technologies. Agenda: phpmyadmin 2/20/2016. phpmyadmin MySQLi. Before you can put your data into a table, that table should exist.

Development Technologies. Agenda: phpmyadmin 2/20/2016. phpmyadmin MySQLi. Before you can put your data into a table, that table should exist. CIT 736: Internet and Web Development Technologies Lecture 10 Dr. Lupiana, DM FCIM, Institute of Finance Management Semester 1, 2016 Agenda: phpmyadmin MySQLi phpmyadmin Before you can put your data into

More information

Custom Fields With Virtuemart 2. Simple Custom Fields. Creating a Custom Field Type

Custom Fields With Virtuemart 2. Simple Custom Fields. Creating a Custom Field Type Customization in Virtuemart 2 Custom Fields With Virtuemart 2 Custom Plugin Fields in Virtuemart 2 Part 1. Installing and Using Custom Plugin Fields Custom Plugin Fields in Virtuemart 2 Part 2. Programming

More information

Jackson State University Department of Computer Science CSC / Advanced Information Security Spring 2013 Lab Project # 3

Jackson State University Department of Computer Science CSC / Advanced Information Security Spring 2013 Lab Project # 3 Jackson State University Department of Computer Science CSC 439-01/539-02 Advanced Information Security Spring 2013 Lab Project # 3 Use of CAPTCHA (Image Identification Strategy) to Prevent XSRF Attacks

More information

WEB PROGRAMMING SCV1223. PHP : Authentication Example. Dr. Md Sah bin Hj Salam En. Jumail bin Taliba

WEB PROGRAMMING SCV1223. PHP : Authentication Example. Dr. Md Sah bin Hj Salam En. Jumail bin Taliba WEB PROGRAMMING SCV1223 PHP : Authentication Example Dr. Md Sah bin Hj Salam En. Jumail bin Taliba Topics Form Handling Redirection Connecting to Database User Authentication Session Authentication Case

More information

Adding content to your Blackboard 9.1 class

Adding content to your Blackboard 9.1 class Adding content to your Blackboard 9.1 class There are quite a few options listed when you click the Build Content button in your class, but you ll probably only use a couple of them most of the time. Note

More information

Introduction to Databases

Introduction to Databases Introduction to Databases Got something to say? Share your comments [/articles/introduction_to_databases/comments/] on this topic with other web professionals In: Articles [/types/articles/] By Paul Tero

More information

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser. Controlled Assessment Task Question 1 - Describe how this HTML code produces the form displayed in the browser. The form s code is displayed in the tags; this creates the object which is the visible

More information

Title and Modify Page Properties

Title and Modify Page Properties Dreamweaver After cropping out all of the pieces from Photoshop we are ready to begin putting the pieces back together in Dreamweaver. If we were to layout all of the pieces on a table we would have graphics

More information

MiTV User Manual Revision 2 July 8, 2015 Prepared by Walter B. Schoustal MicroVideo Learning Systems, Inc.

MiTV User Manual Revision 2 July 8, 2015 Prepared by Walter B. Schoustal MicroVideo Learning Systems, Inc. MiTV User Manual Revision 2 July 8, 2015 Prepared by Walter B. Schoustal MicroVideo Learning Systems, Inc. http://www.microvideo.com 1 The MiTV Video Scheduling System allows you to schedule and stream

More information

SCRIPTING, DATABASES, SYSTEM ARCHITECTURE

SCRIPTING, DATABASES, SYSTEM ARCHITECTURE introduction to SCRIPTING, DATABASES, SYSTEM ARCHITECTURE WEB SERVICES III (advanced + quiz + A11) Claus Brabrand ((( brabrand@itu.dk ))) Associate Professor, Ph.D. ((( Software and Systems ))) IT University

More information

RACKET BASICS, ORDER OF EVALUATION, RECURSION 1

RACKET BASICS, ORDER OF EVALUATION, RECURSION 1 RACKET BASICS, ORDER OF EVALUATION, RECURSION 1 COMPUTER SCIENCE 61AS 1. What is functional programming? Give an example of a function below: Functional Programming In functional programming, you do not

More information

6.001 Notes: Section 15.1

6.001 Notes: Section 15.1 6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define

More information

SQL stands for Structured Query Language. SQL is the lingua franca

SQL stands for Structured Query Language. SQL is the lingua franca Chapter 3: Database for $100, Please In This Chapter Understanding some basic database concepts Taking a quick look at SQL Creating tables Selecting data Joining data Updating and deleting data SQL stands

More information

What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity]

What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity] What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity] MySQL is a database. A database defines a structure for storing information. In a database, there are tables. Just

More information

web.py Tutorial Tom Kelliher, CS 317 This tutorial is the tutorial from the web.py web site, with a few revisions for our local environment.

web.py Tutorial Tom Kelliher, CS 317 This tutorial is the tutorial from the web.py web site, with a few revisions for our local environment. web.py Tutorial Tom Kelliher, CS 317 1 Acknowledgment This tutorial is the tutorial from the web.py web site, with a few revisions for our local environment. 2 Starting So you know Python and want to make

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Basic Uses of JavaScript: Modifying Existing Scripts

Basic Uses of JavaScript: Modifying Existing Scripts Overview: Basic Uses of JavaScript: Modifying Existing Scripts A popular high-level programming languages used for making Web pages interactive is JavaScript. Before we learn to program with JavaScript

More information

HTML Forms & PHP. Database Systems CSCI Dr. Tom Hicks Computer Science Department

HTML Forms & PHP. Database Systems CSCI Dr. Tom Hicks Computer Science Department HTML Forms & PHP Database Systems CSCI-3343 Dr. Tom Hicks Computer Science Department Create Page Faculty-Add.php AddFaculty Page Create page Faculty-Add.php It will be blank for the moment. We are going

More information

COSC344 Database Theory and Applications PHP & SQL. Lecture 14

COSC344 Database Theory and Applications PHP & SQL. Lecture 14 COSC344 Database Theory and Applications Lecture 14: PHP & SQL COSC344 Lecture 14 1 Last Lecture Java & SQL Overview This Lecture PHP & SQL Revision of the first half of the lectures Source: Lecture notes,

More information

DB2 Web Query (REST based) Application Extension. Usage Instructions

DB2 Web Query (REST based) Application Extension. Usage Instructions DB2 Web Query (REST based) Application Extension Usage Instructions Updated March 29, 2016 Page 1 1 Overview... 4 2 Initial Setup... 5 3 Using the Extension... 6 3.1 Modes of use... 6 3.1.1 Browse Mode...

More information

A practical introduction to database design

A practical introduction to database design A practical introduction to database design Dr. Chris Tomlinson Bioinformatics Data Science Group, Room 126, Sir Alexander Fleming Building chris.tomlinson@imperial.ac.uk Computer Skills Classes 17/01/19

More information

Assignment #1: /Survey and Karel the Robot Karel problems due: 1:30pm on Friday, October 7th

Assignment #1:  /Survey and Karel the Robot Karel problems due: 1:30pm on Friday, October 7th Mehran Sahami Handout #7 CS 06A September 8, 06 Assignment #: Email/Survey and Karel the Robot Karel problems due: :0pm on Friday, October 7th Email and online survey due: :9pm on Sunday, October 9th Part

More information

CS4604 Prakash Spring 2016! Project 3, HTML and PHP. By Sorour Amiri and Shamimul Hasan April 20 th, 2016

CS4604 Prakash Spring 2016! Project 3, HTML and PHP. By Sorour Amiri and Shamimul Hasan April 20 th, 2016 CS4604 Prakash Spring 2016! Project 3, HTML and PHP By Sorour Amiri and Shamimul Hasan April 20 th, 2016 Project 3 Outline 1. A nice web interface to your database. (HTML) 2. Connect to database, issue,

More information

MySQL. A practical introduction to database design

MySQL. A practical introduction to database design MySQL A practical introduction to database design Dr. Chris Tomlinson Bioinformatics Data Science Group, Room 126, Sir Alexander Fleming Building chris.tomlinson@imperial.ac.uk Database Classes 24/09/18

More information

CSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I

CSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I CSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I Welcome to your CSCI-1100 Lab! In the fine tradition of the CSCI-1100 course, we ll start off the lab with the classic bad joke

More information

Enterprise Knowledge Platform Adding the Login Form to Any Web Page

Enterprise Knowledge Platform Adding the Login Form to Any Web Page Enterprise Knowledge Platform Adding the Login Form to Any Web Page EKP Adding the Login Form to Any Web Page 21JAN03 2 Table of Contents 1. Introduction...4 Overview... 4 Requirements... 4 2. A Simple

More information

If you re serious about Cookie Stuffing, take a look at Cookie Stuffing Script.

If you re serious about Cookie Stuffing, take a look at Cookie Stuffing Script. Cookie Stuffing What is Cookie Stuffing? Cookie Stuffing is a very mild form of black hat marketing, because in all honesty, this one doesn t break any laws. Certainly, it goes against the terms of service

More information

Things to note: Each week Xampp will need to be installed. Xampp is Windows software, similar software is available for Mac, called Mamp.

Things to note: Each week Xampp will need to be installed. Xampp is Windows software, similar software is available for Mac, called Mamp. Tutorial 8 Editor Brackets Goals Introduction to PHP and MySql. - Set up and configuration of Xampp - Learning Data flow Things to note: Each week Xampp will need to be installed. Xampp is Windows software,

More information

Installing MySQL on the Command Line

Installing MySQL on the Command Line Installing MySQL on the Command Line Overview: These steps will help you get MySQL installed on a command line, which is an alternative to phpmyadmin. You can find a more comprehensive tutorial here. This

More information

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document.

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document. 1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document. 2. W3Schools has a lovely html tutorial here (it s worth the time): http://www.w3schools.com/html/default.asp

More information