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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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