My code php code does not update Mysql, need help to get id_user

I think i do not  establish $cmember['id_user'] after the post submit is made? I belive i don't seem to be sending the payer id after form post is made. how could i establish user id, or any other way around?
Pressing accept or reject, refreshes the page, but does not update 'users' table
<?php
include ("top_tpl.php");
$clan = mysql_fetch_array(count_query("SELECT * FROM `clans` WHERE `id` = '".$row['clan']."'"));
$zap_cmember = count_query("SELECT * FROM `users` WHERE `clan` = '".$clan['id']."' AND `clan_stat` = 'Pending'");

?>

            <?php


                    if (isset($_POST['Yes']))
                    {
                        count_query("UPDATE `users` SET `clan_stat`='Member', read_msg='0' WHERE `id_user`='".$cmember['id_user']."'");
                        $time = date('j.n.y H:i');
                        count_query("INSERT INTO `message` (`time`, `to`, `text`, `metka`) VALUES ('".$time."', '".$cmember['name']."', 'You were accepted into the clan <a href=clan.php>".$clan['name']."</a>', '6')");
                        echo "<script>location.href='clan_plac.php'</script>";
                    }
                    else if (isset($_POST['No']))
                    {
                        count_query("UPDATE `users` SET `clan`='0', read_msg='0' WHERE `id_user`='".$cmember['id_user']."'");
                        $time = date('j.n.y H:i');
                        count_query("INSERT INTO `message` (`time`, `to`, `text`, `metka`) VALUES ('".$time."', '".$cmember['name']."', 'Your application to join clan <a href=clan.php?id=".$clan['id'].">".$clan['name']."</a> rejected', '6')");
                        echo "<script>location.href='clan_plac.php'</script>";
                    }
                $ind = 0;
                while ($cmember = mysql_fetch_array($zap_cmember))
                {
                    echo "<form method='post'><tr><td><a href='player.php?id=".$cmember['id_user']."' target='_blank'>".$cmember['name']."</a></td><td><input type='submit' name='Yes' value='Accept'><input type='submit' name='No' value='Reject'></td></tr></form>";
                    $ind++;
                }
                if ($ind == 0)
                {
                    echo "No applications";
                }
                ?>

<?php include ("footer_tpl.php");?>

Open in new window

Andrius MoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel WilsonCommented:
Lines 13, 15, 20, and 22 assume that $cmember has already been set.

But it is not set until line 26.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ray PaseurCommented:
You probably want to discard this and start over.  The MySQL extension is being removed from PHP, so you need to choose MySQLi or PDO instead.  This article can help you make the conversion, and it also shows how to use the SQL extensions and test for success or failure, and how to visualize any errors.
http://www.experts-exchange.com/articles/11177/PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html

Please read it over and if you're still stuck on anything, post back and we can help with the specifics.

If you're new to PHP and want some good learning resources, this article can help.
Andrius MoAuthor Commented:
thanks, added line "$cmember = mysql_fetch_array($zap_cmember);" to the top and it helped
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.