Re: Double entry into MySQL..
| From: | Michael Sweeney | Date: | Tue, 07 Jan 2003 18:15:26 +0000 |
| Subject: | Re: Double entry into MySQL.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130624@lists.php.net to get a copy of this message | ||
There's nothing in your posted code that could cause two inserts into
mysql. The only thing I can think of is that somehow, your script is
getting executed twice. Is there any way that could be happening?
..michael..
On Mon, 2003-01-06 at 16:03, Altug Sahin wrote:
> Hi here,
>
> I am sending a file to user's browser and logging the downloaded file into
> MySQL but everytime this script works, I see double entry in the MySQL
> table... Why is this happening?
>
> Any ideas?
>
> Thanks
>
> <?
> $today = date("Y-m-d");
>
> $conn = db_connect();
>
> if(!$conn)
> echo "Can't connect to database...";
>
> $query = "INSERT INTO track_dl (dldate, email, file)
> VALUES ('$today', 'user@email.com', 'file.ext')";
>
> $result = mysql_query($query);
>
> if(!$result)
> echo "Can't execute query: " . mysql_error();
>
> header("Content-type: application/pdf");
> readfile("file.pdf");
> exit();
> ?>
--
Michael Sweeney <sweeney@verisity.com>
Verisity Design, Inc