Technology & Management Club Development Software Overview
Summary PHP Server-side scripting language for websites MySQL SQL Database CVS Version and collaboration management
Summary - Client Server Model Server Client Request Response
Summary - Client Server Model URL Query String (GET Method) &name2=val2&name3=val3… Form Data (POST Method) Consists of all data from form elements on a page, including textboxes, checkboxes, menus, etc. and hidden fields Request
Summary - Client Server Model Server has three tasks 1) Accept incoming request 2) Process PHP script 3) Output response (which is just text, usually in the form of HTML)
PHP - Examples <?php echo “hello world!”; ?> hello world!
PHP - Examples This is an example of PHP <?php echo “embedded”; ?> Inside of HTML. This is an example of PHP embedded in HTML
PHP - Examples <?php $sum = 0; for($i = 0; $i <= 5; $i++) { $sum = $sum + $i; } echo “Sum: ”.$sum; ?> Sum: 15
PHP - Examples Request: “ ?favorite_color=blue” <?php echo “My favorite color is: ”; echo $_GET[“favorite_color”]; echo “.”; ?> My favorite color is: blue.
PHP - Examples <?php function factorial($n) { if($n > 1) return $n * factorial($n - 1); } ?> The factorial of 5 is: <?php echo factorial(5); ?> The factorial of 5 is: 120
MySQL - Introduction Structured Query Language MySQL is a free, open-source implementation of a SQL database A database is a collection of tables A table is a collection of rows and columns (also called records and fields) Think of a table as an Excel spreadsheet SQL is a language for manipulating and searching tables in databases
MySQL - An Example Data Base UserID_PKUserNamePassword 1jsulkinaaa 2jkinzerbbb BookID_PKTitleDeptID_FK 1Book12 2Book22 DeptID_PKName 1ECE 2Finance
MySQL - Examples <?php $conn = mysql_connect($server, $username, $password); mysql_select_db($dbname, $conn); $query = “SELECT * FROM table_name”; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { echo $row[“colname”].” ”; } ?> book1 book2
MySQL - Basic Queries SELECT cols FROM table_name WHERE query INSERT INTO table_name (col1, col2, …) VALUES (val1, val2…) UPDATE table_name SET col1=val1, col2=val2, … DELETE FROM table_name WHERE query
CVS - Introduction Concurrent Versioning System Two purposes: Allow different people to collaborate on a common set of documents Allow each version of the documents to be saved and recalled
CVS - Basics > cd htdocs/ ---before you start coding--- > cvs update -Pd ---after you have verified working code > cvs update -Pd > cvs commit