![]() |
I need a little help with updating to a database record
I have tried to update data and for the most part it works, number one it can only be text no punctuation what so ever, if an apostrophe is used for example (i'm go) this is the error that is given
" You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'm go' at line 1" and the second is that the page refresh causes it to re-update and blank out the database how would i fix that? please help it is driving me nuts.. thanks |
1 Attachment(s)
For the escaping of characters which conflict with MySQL, take a peak at the following two functions on PHP.net. They will help you very much in preventing those pesky errors:
As for the problem of reposting POST data, take a look at the following example I have created for you. This, I hope, explains it better than any number of words could! Please do ask any questions though if you're unsure. |
thanks for the fast response.. I am not sure i did it right.
1 Attachment(s)
Attachment 206
i have attached a copy of my code. dont laugh at my attempt..I have done enough of that for the both of us!!!;-):-D j/k but in all seriousness I am still unsure of it.. sorry I am really uneducated in php. the little i know is because of HAVING to trial and error it out.. lol thanks again |
1 Attachment(s)
I will assume you've got the session booleans (true and false) in the correct order. I have amended your code. Please try it now.
|
now it wont post..lol.. this is too funny.. I appreciate it
|
I assume then that you have the booleans configured incorrectly. Basically the SESSION variable must be true to POST, and false once submitted. The value is returned to true again once you reload the actual form and then resubmit.
|
I am not sure that I understand what you mean.. I am truly sorry.. I copied it as you wrote it... and i dont get it posted.. maybe i am doing something wrong?!?!?
|
| All times are GMT. The time now is 09:07 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0