MySQL1 Database Connections (8)

Card Set Information

Author:
dalbabes
ID:
102733
Filename:
MySQL1 Database Connections (8)
Updated:
2012-07-26 11:36:51
Tags:
PHP
Folders:

Description:
PHP class
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user dalbabes on FreezingBlue Flashcards. What would you like to do?


  1. function to convert the ' so that it doesn't mess up the code
    addlashes()
  2. 2 steps to make a query, including
    • 1. Make a variable with the query
    • 2. create a variable that pulls the first variables result using mysql_query()

    • $command = "SELECT * FROM friends;";
    • echo "Command: ".$command."<br>";

    $result = mysql_query($command);
  3. Function to pull data from a queried variable
    • mysql_fetch_object()
    • $data = mysql_fetch_object($result)
  4. What approach would you use to get data out of a queried variable
    • while ($data = mysql_fetch_object($result)) {
    • echo $data->first_name

    }
  5. Two steps to connect to a database
    • 1. Create a variable with mysql_connect(host, user, pw)
    • 2. Call that variable with a new variable using myql_select_db($database, $db);
  6. What function stores the host, user, and password?
    mysql_connect($host, $user, $pw)
  7. Function to select a database
    mysql_select_db($database, $db)
  8. function that works as a backup if the login function fails
    or die()
  9. End a session
    mysql_close($database)
  10. Insert something into the database
    $variable = mysql_query(insert into...);

What would you like to do?

Home > Flashcards > Print Preview