Q: Get variable isn't written to database I've got this code
$cislonakupu=$_GET['cislonakupu'];

    if($_REQUEST['command']=='update'){
        $datum = Date("j/m/Y H:i:s", Time());
    $user1=mysql_query("SELECT * FROM `register` WHERE `username`='$session'");
    $mu=mysql_query("SELECT * FROM `velikostiobj` WHERE `objednavkac`='$cislonakupu'");$cislonakupu=$_GET['cislonakupu'];

        $customerid=mysql_insert_id();
        $date=date('Y-m-d');
        $orderid=mysql_insert_id();

        $max=count($_SESSION['cart']);
        for($i=0;$i<$max;$i++){
            $pid=$_SESSION['cart'][$i]['productid'];
            $q=$_SESSION['cart'][$i]['qty'];
            $price=get_price($pid);
            $cp=$_POST['cp'];
        $velikots=$row['velikost'];

$n= date('j/m/Y H:i:s', strtotime($Date. ' + 14 days'));

    while ($row=mysql_fetch_array($mu)) {

                        $resultik=mysql_query("INSERT INTO `objednavkyinfo`(cislonakupu,produkt,mnozstvi,cena,cislofaktury,username,datumnakupu,dorucitdodata,velikost,dorucspol) VALUES ('$cislonakupu','$pid','$q','$price','$cislofaktury','$session','$datum','$n','$velikots','$cp')") or die(mysql_error());
}

        }
        header("Location: shoppingcart.php?delete=ano");


    }

I need to write $velikots to and database.
If $velikots="Some text"; - It's working
If $velikots=$row['velikost']; - Not working
Where's the problem?

A: You never fetch your results. You are trying to use the results of your query before you actually fetch them from your database. 
$row = mysql_fetch_assoc($mu);
$velikots = $row['velikost'];

You should then be able to remove your while loop:
 while ($row=mysql_fetch_array($mu)) { ... } // remove this.

Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial. You are also wide open to SQL injections
