Select statement not working

admin

Administrator
Staff member
I'm going nuts. I need to be able to select information from the database that correlates to the variable "ID" that is passed to the page. Every blessed time I try it, I get the following error:

Warning: 0 is not a MySQL result index in /home/users/kking/news/edit.php3 on line 11

Here's the code. I know I'm doing something stupid, but I can't figure it out.

<?php

$db = mysql_connect("localhost", "root");
mysql_select_db("ktul", $db);

$query = "SELECT * FROM " .
"news " .
"WHERE (ID = '$id')";
$dbResult = mysql_query($query, $db);

$headline = mysql_result($dbResult, $i, "Headline");
$content = mysql_result($dbResult, $i, "Content");
?>
 
Back
Top