Databases Reference
In-Depth Information
echo " $argument";
echo "!\n";
}
?>
Now when you type in any number of arguments after the command name, they will
be displayed as part of the greeting:
$ ./hello.cl.all_args.php
Syntax: ./hello.cl.args.php [Your Name]
$ ./hello.cl.all_args.php Somayyeh
Hello, Somayyeh!
$ ./hello.cl.all_args.php Somayyeh Sadat Sabet
Hello, Somayyeh Sadat Sabet!
Resources
We listed several resources on web database applications and PHP at the end of Chap-
ter 13. This section lists resources you can read that contain more about using PHP
with MySQL.
The descriptions we've provided in this chapter are simplified: we've omitted function
parameters that are rarely used, avoided some of the details of how the functions are
used, and shown some optional parameters as mandatory. See the MySQL manual
( http://www.php.net/manual/en/ref.mysql.php ) for more detail on MySQL functions.
There are also many useful web sites that include tutorials, sample code, online dis-
cussion forums, and links to sample PHP applications. The official PHP site links page
( http://www.php.net/links.php ) points to most of these sites. These include:
http://dev.mysql.com/usingmysql/php
The MySQL AB web page on using PHP with MySQL
http://php.net/manual/en/ref.mysql.php
The PHP manual section on MySQL
Exercises
1. In a PHP script, how can we access data entered by a user in an HTML form?
2. Why is it important to untaint information that arrives from the client?
3. What is the difference between the PHP library functions mysqli_num_rows( ) and
mysqli_affected_rows( ) ?
4. When would you pass a variable to a function by reference rather than by value?
5. What does this program do?
#!/usr/bin/php
<?php
$Time="2006-06-20 19:00:00";
 
Search WWH ::




Custom Search