tecdesign Posted April 25, 2006 Share Posted April 25, 2006 [code]while ($i < $l){$query = mysql_query("SELECT max( topicid ) as topicmaxFROM topics");$max_check = mysql_num_rows($query);if($max_check > 0){ while($row = mysql_fetch_array($query)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); }session_register('topicmax');$_SESSION['topicmax'] = $max; }}$maxit = $max - $i;[/code]Ok what I am having trouble with is I want to take max (topicid) from the sql statement and pretty much make $max = max(topicid). Does anyone know how to do this? Quote Link to comment Share on other sites More sharing options...
Barand Posted April 25, 2006 Share Posted April 25, 2006 [code]$query = mysql_query("SELECT max( topicid ) FROM topics");$max = mysql_result ($query, 0);[/code] Quote Link to comment Share on other sites More sharing options...
tecdesign Posted April 25, 2006 Author Share Posted April 25, 2006 Thanks Barand. I am trying to create my own forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.