"Adam Richardson" <[email protected]> wrote in message
news:[email protected]...
> >
>> 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.
>
>
> Gary had mentioned in his initial post he was testing on a local machine
> and
> would add the checks after resolving this issue.
>
>
>>
>
> 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') &&
>
>
> Tedd, Gary's original code does include jpeg AND pjpeg types (if you omit
> pjpeg's, you'll miss some images.)
>
> That said, Gary, Tedd did point out some important issues with the logic
> in
> your code.
>
> Additionally, you were asked politely to not top post, but you continued
> to
>> do so. If you expect us to help you but you won't accommodate a simple,
>> and
>> appropriate request, then don't expect any more help from me.
>
>
>> bye!
>
>
> Where was he asked to avoid top-posting in this thread?
>
> What is top posting?
>
>
> Gary, top-posting is when you add your content to an email thread at the
> top
> (as opposed to the bottom) of the email message. The preferred method of
> this list's admins is that you add your reply to the bottom of the message
> thread. So, in future posts, please try to remember to add your message
> to
> the bottom of the thread instead of the top. Thanks :)
>
> Gary, what is the INSERT line for the images table supposed to be (it
> looks
> like it got mangled in your copying and pasting?)
>
> $sqlStatements = "INSERT INTO guns( id,manufacturer, type, model,
>
> caliber, condition, price, description, image_file_name,submitted
>
> ,available) VALUES ('','$manufacturer', '$type', '$model', '$caliber',
>
> '$condition', '$price', '$description','$image_file_name', ' ',
>
> '$available');
>
>
>> INSERT INTO images (id, image_file) VALUES('','$image_file')";
>
>
>> $sqlResult = $batchconnection->multi_query($sqlStatements);
>
> if($sqlResult == true) {
>
> echo "Successfully Inserted Records";
>
> } else {
>
> echo "Some Error Occured While Inserting Records";
>
> }
>
>
> Adam
>
> --
> Nephtali: PHP web framework that functions beautifully
> http://nephtaliproject.com
>
>
>
> __________ Information from ESET Smart Security, version of virus
> signature database 5077 (20100501) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
Adam
Thank thank you for your reply.
This is the code for the INSERT
$sqlStatements = "INSERT INTO guns (manufacturer, type, model, caliber,
condition, price, description, image_file_name, available) VALUES
('$manufacturer', '$type',
'$model','$caliber','$condition','$price','$description','$image_file_name','$available');
INSERT INTO images(id, image_file) VALUES ('', '$image_file')";
This seems to be the stopping point because when I intentionaly create
errors (connecting to db) then the error message I created shows up. None
of the data is being inserted into the DB.
This script works fine in another DB on the same server.
$sqlStatements = "INSERT INTO images(caption, where_taken,description,
file_name, image_file) VALUES ('$caption','$where_taken','$description',
'$file_name','$image_file');
INSERT INTO keywords (image_id,fox, wolves, wildlife, scenic, birds, eagles,
deer, small_mammals, large_mammals, dogs, cats, flowers, insects, bear,
moose)
VALUES('','$fox','$wolves','$wildlife','$scenic','$birds','$eagles','$deer',
'$small_mammals', '$large_mammals','$dogs', '$cats', '$flowers', '$insects',
'$bear', '$moose')";
As far as the whole "top posting". I have been posting on this board for 2
years (give or take), in fact have had a number of exchanges with tedd, (so
I was a little surprised at his response). I have never heard the term top
posting, I had not been asked not to top post. Jim Lucas had at the bottom
of his reply.
Jim Lucas
A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
However I read that as a signature line, not a request.
So, sorry if I offended.
Adam
Again, thank you for your response, I appriciate any help you might be able
to offer.
Gary
__________ Information from ESET Smart Security, version of virus signature
database 5077 (20100501) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php