the problem i am facing is i want to read a value that is auto incemented and used, my database takes the following design:
| id | category | image | | 13 | paper | 0 |id is auto_incremented, what i want to do is generate the id and use it as the value in image and then upload a file which has his name as the number stored in image, in this example image will be changed to 13 and the file will have the name of 13.jpg. I started my code by doing this
mysql_query("INSERT INTO category (category,image) VALUES ('$name','$default_item')");
$name is written by the user and $default_item is always zero, what i want to do is change the image to equal id using update and upload an image like this
$image_name = '$id' . '.jpg'
move_uploaded_file($_FILES["image"]["tmp_name"], "../images/category/" . $image_name);
Where $id is the id in the database