Jump to content

Whats wrong with my query


mike12255

Recommended Posts

ive looked at this for a while now and im not sure whats wrong, the error occured when i entered $cat and catagory into it, without that the query works perfectly fine, any help appreciated.

<?php
INSERT INTO newnotes (uid, name, catagory, location) VALUES ('1', 'test', '1001 Laws - Polceing', '/home/mikeh/public_html/uzEr Upl0ds/Alyssa O'Leary.doc')

 

the <php tag is only to give color and make it less dull the query is from a die($query) statment

Link to comment
https://forums.phpfreaks.com/topic/225157-whats-wrong-with-my-query/
Share on other sites

I think it is because of the ' before Leary. This will place /home/mikeh/public_html/uzEr Upl0ds/Alyssa O in the location value and then simply place Leary.doc') after it, which should be the reason of your error.

 

To fix it, I guess you could put it in a variable? Like:

 

$filename = "/home/mikeh/public_html/uzEr Upl0ds/Alyssa O'Leary.doc"

 

I think that should work (not certain)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.