Jump to content

[SOLVED] Help Please - I am getting strange problem.


jaas

Recommended Posts

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..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.