Here is my code...
$query = SELECT max(id) FROM bc_topic;
$result = mysql_query($query);
$temp = mysql_result($result, 0, id); - this is line 8
echo $temp[id];
Here is the error I get ...
Warning: id not found in MySQL result index 2 in /.../upload2.php on
line 8
What am I doing wrong here?
Try this:
$query=select max(id) as id from bc_topic;
Leave the rest the same. I'm not so sure that the max(id) selection will
populate a column named id necessarily (in fact, I think it doesn't).
That may be your problem.
Chris
Phil Schwarzmann wrote:
Here is my code...
$query = SELECT
PS Here is my code...
PS $query = SELECT max(id) FROM bc_topic;
PS $result = mysql_query($query);
PS $temp = mysql_result($result, 0, id); - this is line 8
PS echo $temp[id];
PS Here is the error I get ...
PS Warning: id not found in MySQL result index 2 in /.../upload2.php on
PS line 8
PS
3 matches
Mail list logo