include "projects_library.php"; // Connect to database mydb_connect(); // Structure and commit query $query = "SELECT p_id, p_title, p_text, u_name, u_email FROM Projects ORDER BY p_title"; $rows = mysql_query ($query); $count = mysql_num_rows ($rows); // If no entries found if ($count == 0) { $error_string = "No projects found in the database!"; errortext ($error_string); } // Construct project list $project_tables = ""; while ($row = mysql_fetch_row($rows)) { $p_id = $row[0]; $p_title = $row[1]; $p_text = nl2br ($row[2]); $u_name = $row[3]; $u_email = $row[4]; $table = '
| '.$p_title.' | '."\n" .'By: '.$u_name.' | '."\n" .'
|---|---|
| '.$p_text."\n" .' '."\n" .' | '."\n" .'|
[ Add new project ]
'."\n" .$project_tables; // Render page render_page('Project Base', $body); ?>