I am having a really odd problem here, in that I can replace a record but cant create new ones for some reason. If I create an album with id = 2hdfhh4 and then submit an album with the same id the details get updated. If I try posting a new album nothing happens, I don't even get any errors either ?.

```
    include("connect.php");
    $photostring = implode(',',$photos);
    $albumname = htmlspecialchars($albumname);

        $sqlA = <<<SQL
        SELECT *
        FROM `albumorders`
        WHERE albumid = '$albumid' 
        LIMIT 1
    SQL;

    if(!$resultA = $db->query($sqlA)){
        die('There was an error running the query [' . $db->error . ']');
    }
    while($rowA = $resultA->fetch_assoc()){
        if ($albumid = $rowA['albumid']){
            mysqli_query($db,"UPDATE albumorders SET `albumid`='$albumid',`albumname`='$albumname',`imagesordered`='$photostring' WHERE `albumid`='$albumid'");
            }
            else {
                mysqli_query($db,"INSERT INTO albumorders (`albumid`,`albumname`,`imagesordered`) VALUES ('$albumid','$albumname','$photostring')");
            }
        }

```

My table looks like this :

![enter image description here](https://i.stack.imgur.com/YGcbn.jpg)