'; echo 'Date format is YYYY-MM-DD / 1977-06-07
'; echo 'Please click HERE to try again'; include_once ('footer.php'); exit(); } $sqlupdate = "UPDATE `pops` SET `popno` = $fno, `popname` = '$fname', `popcollectionid` = $fpcid, `inserteddate` = '$fdate' WHERE `funkoid` = $fid AND `userid` = $userid"; if (!$result = $con->query($sqlupdate)){ die ('There was an error running the query [' . $con->error . ']'); } echo $fname . ' info successfully updated, returning to editor.'; header("refresh:2;url=edit.php?id=$fid"); include_once ('footer.php'); exit(); } else { echo 'Editing data
'; if (!$editid == "") { $sqlfind = "SELECT * FROM (pops INNER JOIN popcollection ON pops.popcollectionid = popcollection.popcollectionid) WHERE `funkoid` = $editid AND `userid` = $userid"; if (!$result = $con->query($sqlfind)){ die ('There was an error running the query [' . $con->error . ']'); } echo '
'; while ($row = $result->fetch_array()){ $fid = $row['funkoid']; $fuid = $row['userid']; $fno = $row['popno']; $fname = $row['popname']; $fpcid = $row['popcollectionid']; $fdate = $row['inserteddate']; $fcollection = $row['popcollection']; $_SESSION['popno'] = $fno; $_SESSION['popname'] = $fname; echo ''; echo ''; } echo '
Pop NoPop NamePurchase DatePop Collection
'; echo '
'; echo ''; echo '

'; $sqlimage = "SELECT popimages.imageid, popimages.imagepath FROM popimages WHERE popimages.funkoid = $fid AND popimages.userid = $fuid"; if (!$result3 = $con->query($sqlimage)){ die ('There was an error running the query [' . $con->error . ']'); } if (mysqli_num_rows($result3) == 1) { $row3 = mysqli_fetch_array($result3); echo '' . $fname . '
'; $_SESSION['imageid'] = $row3['imageid']; $_SESSION['imagepath'] = $row3['imagepath']; $_SESSION['image'] = "existing"; } else { echo ''; $_SESSION['image'] = "default"; } echo '
'; echo '


'; } else { echo 'Please select a Funko Pop to edit!'; } } echo 'Retun to Funko Pop list
'; } include_once 'footer.php'; ?>