Re: what is wrong with this simple query?
| From: | Chris Shiflett | Date: | Tue, 25 Jun 2002 02:14:08 +0000 |
| Subject: | Re: what is wrong with this simple query? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103715@lists.php.net to get a copy of this message | ||
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 max(id) FROM bc_topic"; $result = mysql_query($query); $temp = mysql_result($result, 0, "id"); <- this is line 8 echo $temp[id];