PHP question

Out of context: Reply #1

  • Started
  • Last post
  • 7 Responses
  • Lillebo0

    // Connect to server
    $connection = mysql_connect(host, username, password);

    // Select database
    mysql_select_db('db_name', $connection);

    // Query database for table data
    $query = "SELECT * FROM table_name";
    $query_result = mysql_query($query);

    // Output data
    while ($row = mysql_fetch_assoc($query_result... {
    echo $row['headline'];
    }

    // Close connection
    mysql_close($connection);

    • Typo on 12th line. The three dots should be a closing parenthesis.Lillebo

View thread