All pastes #372704 Raw Edit

problem

public php v1 · immutable
#372704 ·published 2007-02-26 07:20 UTC
rendered paste body
<?php	include "files/mysql.php";	mysql_connect($db_host, $db_user, $db_pass);	mysql_select_db($db_name) or die("Failed to select db");	$query = "SELECT id, ndate, title, cont FROM news";	$result = mysql_query($query);	$numrows = mysql_num_rows($result);	if(1>$numrows) {die("No records added yet!");}	echo "<a href='output.php?action=new'>Add Record</a>";	echo "<table border='0'>";	echo "<tr><td>ID</td><td>Date</td><td>Title</td><td>Content</td><td>Action</td></tr>";	for($i=0;$result>$i;$i++) {		$id = mysql_result($result, $i, "id");			$ndate = mysql_result($result, $i, "ndate");			$title = mysql_result($result, $i, "title");			$cont = mysql_result($result, $i, "cont");			echo "<tr><td>".$id."</td><td>".$ndate."</td><td>".$title."</td><td>".$cont."</td><td><a href='output.php?action=delete&id=".$id.">Delete</a><a href='output.php?action=edit&id=".$id.">Edit</a></td></tr>";			}	echo "</table>";	mysql_close();?>