Re: binary data in php

From: Date: Fri, 16 Apr 2004 04:02:42 +0000
Subject: Re: binary data in php
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-183587@lists.php.net to get a copy of this message
Anthony Ritter wrote:
I inserted the mysql_query() below but it still doesn't upload the file nor does it throw an error. [snip]
        // Create the SQL query.
$sql = "INSERT INTO binary_data SET filename = '$uploadname', filetype = '$uploadtype', description = '$uploaddesc', bin_data = '$filedata'"; $ok = @mysql_query($sql); if(!$ok)die('Database error storing the file:'.mysql_error()); $id= mysql_insert_id();
       print "<p>This file has the following Database ID: <b>$id</b>";
       echo "<br>";
       echo "<a href=\"getdata.php?id=$id\">Click to view file</a>";
       MYSQL_CLOSE();
So what's the output? How do you know it's not working? If you're not getting an error, then your query is running and something is going in the database. Are you sure the problem isn't in how you're displaying the data? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#183587) next »