On the same page that an INSERT INTO takes place, I need to grab that newly created row's auto increment value to store a unique URL inside another column on the same row, and have an image to represent the url.
I figure that after the data submission, a new query could be made to get the newest id (using mysqli_insert_id) and place the id at the end of a url, then INSERT or UPDATE that url into a column.. is that right?
I've tried a few things, but I either get errors, or no errors but no UPDATE or INSERT happens. Here is what I was just messing with.
//Grab new insert ID
<input type="radio" name="editurl" value="http://www.somesite.com/somefile.php?variable=$id" style="display:none;" checked="checked">
//Insert value containing specific ID
$editlink="UPDATE $tbl_name SET edit='$editurl' WHERE id='$id'";
$result=mysqli_query($link,$editlink) or die("Error: ".mysqli_error($editlink));
I was trying with this, hoping to at least get the URL into the database, then go from there.. though even if it worked, I'd still be unsure how to get an image to display in place of text.
Any tips on accomplishing this would be helpful