Re: Any One See where this is going wrong?
| From: | tedd | Date: | Sat, 01 May 2010 15:24:54 +0000 |
| Subject: | Re: Any One See where this is going wrong? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-304807@lists.php.net to get a copy of this message | ||
At 1:45 AM +0100 5/1/10, Ashley Sheridan wrote:
On Fri, 2010-04-30 at 20:43 -0400, Gary wrote:-snip-I have this duplicate code on another site and it works fine. The image is uploaded to the images folder, the information is not submitted to the database. I get the error Some Error Occured While Inserting Records This is only on a local machine so I have not yet included and safegaurds like stripslashes or my_real_escape_string. Thanks for your help Gary <?php if (isset($_POST['submit'])) { $manufacturer=($_POST['manufacturer']); $type=($_POST['type']); $model=($_POST['model']); $caliber=($_POST['caliber']); $condition=($_POST['condition']); $price=($_POST['price']);$description=($_POST['description']); -
Is it possible that this server doesn't like batch queries? Try splitting them out into individual queries and seeing if that helps. If that doesn't do the trick, print out the SQL query string to see if it's what you expect. It might be working fine on the other server, but I've seen enough strange things happen before to know that sometimes 'poo' happens. Thanks, Ash http://www.ashleysheridan.co.ukAsh: 'poo'? Wow, you're becoming quite the Hemingway :-) If the OP does clean his $_POST before putting the results in his database, his database will look like 'poo' if the wrong person comes along. Also, the OP's code reads: ($image_type == 'image/pjpeg') || ($image_type == 'image/png') && That should be: ($image_type == 'image/jpeg') || ($image_type == 'image/png') && Regardless of IF the code runs OK somewhere else it won't if it's dealing with a jpeg or even a jpg image. Plus, the logic is screwed because -- $src = imagecreatefromjpeg($this -> originalFile); -- always assumes the file is going to be a jpeg, but then later he test for different image types. What's the reason for that? And I don't see where he provides the values for $newWidth and $newHeight used in the resample. Here's a simpler example: http://webbytedd.com/b/thumb/ Just add the png type to the header content. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com