Putting it all together: Using PhP
Following is a brief summary of some of the concepts
on PhP and MySQL that we have covered in class:
Here are some notes about writing and running PhP
with MySQL on i5.nyu.edu:
- Your_php_script must be located in public_html/cgi-bin
- The first line of your PHP script has the directive: #!/usr/local/bin/php
- Use chmod 755 <filename.php> in order for it to be world-executable.
- Your database name is the same as your netid.
Examples in Class: (based on these scripts: composers_script.sql,
Running a query
Running a query with selection criteria
Running a query using a variable with the selection criteria
Running a query using user input from an HTML form as the selection criteria
Running a query using user input from an HTML form and determining the number
of records found which match the criteria; issue a warning to the user if
no records are found.
Running a query using user input from an HTML form and two related tables
for php_mysql*.php files: This is stored as a Word document so that the browser
does not interpret it.