PHP_MySQL

  1. PHP scripts run only after an event occurs.
  2. all PHP scripts must be accessed through a URL 
  3. .profile file(MAMP):
    export PATH=$PATH:/Applications/MAMP/Library/bin

    .profile file(manual):

    export: PATH=$PATH:/usr/local/mysql/bin
  4. the action attribute of a form: the value of it is the URL that will be loaded when the user clicks the Submit button. The data the user has typed in the form will be sent to this URL via the method specified in the method attribute, either get (appended to the end of the URL) or post (sent as a separate message). 
  5. The main reason for using a server-side scripting language is to be able to provide dynamic content to a site’s users. 
  6. One of the $_GET or $_POST arrays holds the details of all the form variables.Which array is used depends on whether the method used to submit the form was GET or POST, respectively. In addition, a combination of all data submitted via GET or POST is also available through $_REQUEST. 
  7. PHP scripts must always be "opened" through a URL from a web server.
  8. Concatenation involves sticking more than one string together to form a completely new string. concatenation always results in a string.
  9. characters in PHP are escaped with a "/".
  10. PHP handles strings differently depending on whether they’re enclosed by single or double quotes. Newline characters (\n) can only be escaped in double-quoted strings. Single-quoted strings are considered raw text, whereas PHP processes double-quoted strings looking for variables. When a variable is encountered within a double-quoted string, PHP inserts its value into the string as if the strings had been concatenated. So not only is a double-quoted string necessary to make the newlines work in the email message, but it also allows us to simplify the code by sticking the variables directly in the string. Single-quoted strings only allow the \' and \\ escape characters—all other escape characters can only be used in double- quoted strings. 
  11. PHP built-in mail() function: 
    // sytax: mail(to, subject, message [, headers [, parameters]])
    <?php
    $to = "someone@example.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "someonelse@example.com";
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
    ?>
  12. MySQL create databases and tables:
    CREATE DATABASE aliendatabase;
    USE aliendatabase;
    CREATE TABLE sometable (
        first_name varchar(30),
        last_name varchar(30)
    );
  13. Check MySQL server:
    //; /usr/bin 
    mysqladmin --version
  14. MySQL ships with a blank password for the root MySQL user. 
  15. n
  16. n
  17. n
  18. n
  19. n
  20. n
  21. n
posted @ 2013-07-15 11:05  wxwcase  阅读(153)  评论(0编辑  收藏  举报