jaas Posted November 10, 2008 Share Posted November 10, 2008 hi, I am having a php loop as follows : There are two tables with data are present in database - users and forum_replys if (session_is_registered="valid_user") { $sql1 = mysql_query ("select max(seq_no) from forum_replys where forum_id = 1") or die (mysql_error); $result1 = mysql_array_fetch($sql1); $tmp_seq_no = $result(seq_no); echo $tmp_seq_no; $sql2 = mysql_query ("select max(user_id)+1 from users") or die (mysql_error); $result2 = mysql_array_fetch($sql2); $tmp_user_id= $result(user_id); echo $tmp_user_id; } The problem I am getting is when the control is going inside the loop, it is not showing any result for the $sql1 statement. But show for the $sql2 statement. If I removes "max" from the $sql1 statement then it shows result. I am not getting how to tackle with this. Please help.. Link to comment https://forums.phpfreaks.com/topic/132104-solved-help-please-i-am-getting-strange-problem/ Share on other sites More sharing options...
rhodesa Posted November 10, 2008 Share Posted November 10, 2008 i assume this was a quick retype of the actual code since this code has a syntax error on pretty much every line...can you post the real code? Link to comment https://forums.phpfreaks.com/topic/132104-solved-help-please-i-am-getting-strange-problem/#findComment-686636 Share on other sites More sharing options...
jaas Posted November 11, 2008 Author Share Posted November 11, 2008 hi, thanks for reply. Ya this was a quick retype of the code. The problem got fixed. Regards. Link to comment https://forums.phpfreaks.com/topic/132104-solved-help-please-i-am-getting-strange-problem/#findComment-687491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.