<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 8/26/12 9:32 PM, Kamal Palei wrote:<br>
</div>
<blockquote
cite="mid:CALO8XuUN7f-xrmdr4wth4_QrN-i2RJdQhV1mC6_iwbpPEzE7qg@mail.gmail.com"
type="cite">
<div>Hi Jamie Holly</div>
<div>Thanks for kind reply.</div>
<div> </div>
<div>You are right, I just deleted the entry and added a new entry
in files table, it looks fine.</div>
<div> </div>
<div>I have a small concern. The 'fid' column in files is of type
serial. But I do not want <font face="Times New Roman" size="3">unnecessary</font> increment
of fid values. For that purpose, while inserting new record, I
am just making use of last fid value of that user. Code as below</div>
<div> </div>
<div><font>
<p>db_query("INSERT INTO {files} (fid, uid, filename,
filepath, filemime, filesize, status, timestamp) VALUES (%d,
%d, '%s', '%s', '%s', %d, %d, %d)", $LastFID, $file->uid,
$file->filename, $file->filepath, $file->filemime,
$file->filesize, $file->status, $file->timestamp);</p>
<p>Hope I am not doing any mistake while re-using last FID
value.</p>
<p> </p>
<p>Regards</p>
<p>Kamal</p>
<p>NECS, Bangalore</p>
</font></div>
<br>
</blockquote>
One other option, is if the user has already updated a file, rather
than deleting the database record and inserting a new one, do a
replace or update query to change the existing one.<br>
<br>
Reusing a deleted serial value should be ok too.<br>
<pre class="moz-signature" cols="72">--
Richard Damon</pre>
</body>
</html>