sandy1028 Posted August 1, 2007 Share Posted August 1, 2007 Hi, How to add the serial number to txt file as auto increment when the new data is entered. Is there any any to auto increment the serial number <?php $name=$_POST['name']; $data="$name"; $fp= fopen("data.txt","a") or die("can't open file"); fwrite($fp, $data); fclose($fp); } ?> Link to comment https://forums.phpfreaks.com/topic/62788-add-serial-number/ Share on other sites More sharing options...
btherl Posted August 1, 2007 Share Posted August 1, 2007 Auto increment is a database concept, rather than a text file concept. You may be able to use the "modified time" fetched by stat() as a substitute. Or you can manually add a value in the text file and update it yourself each time. Link to comment https://forums.phpfreaks.com/topic/62788-add-serial-number/#findComment-312597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.