I'm trying to create a new row, in which the image name is the same as the recordID (plus '.png'). The recordID is an auto-incremented int.
This makes a new record:
mysql_query("INSERT INTO record (name,age) VALUES ('$name','$age'')");
..and this gets the recordID:
$newRecordID = mysql_insert_id();
but how do stick the recordID's value into a image_name column (plus '.png'), without having to search for it again?
You don't need to stick '.png' to your image at all, your logic implies that each record contains info about image with extension png. Why would you even need another column then to store the image name?
The second part is that you are using a reserved word for your column name. Keyword NAME
is reserved, you should always avoid it.