shaved92bravada Posted December 24, 2008 Posted December 24, 2008 $changeinfo = sprintf("UPDATE `usershops` SET `location` = `%d` , `shopname` = '%s', `shopdescription` = '%s' WHERE `userid` = ('%u')",$_POST['sl'], $_POST['shopname'],$_POST['description'], $userid); $db->query($changeinfo); I am getting this error QUERY ERROR: Unknown column '1' in 'field list' Query was UPDATE `usershops` SET `location` = `1` , `shopname` = 'Testing ', `shopdescription` = 'Testing functions still' WHERE `userid` = ('1') I am still trying to get used to using sprintf so if I am doing something that I shouldn't be point me in the right direction please. Quote
AlabamaHit Posted December 24, 2008 Posted December 24, 2008 Re: can someone tell me what I am doing wrong here ('%u') to '%u' Quote
shaved92bravada Posted December 24, 2008 Author Posted December 24, 2008 Re: can someone tell me what I am doing wrong here still getting the same error... it has something to do with the location I am just not sure what but if I dont need the () around the `%u` then that will save two extra keystrokes lol. anyway the location field in the table is int (11) just like normal I just can't figure out why it is saying unknown field and then the location # when it should just update the location to that number..... any more help will be appreciated. I am attempting to make my own usershops mod if your wondering lol. Quote
shaved92bravada Posted December 24, 2008 Author Posted December 24, 2008 Re: can someone tell me what I am doing wrong here worked like a charm Luke.... thank you very much. I will take this and learn from it. Atleast I know I have people here that will help me. Thanks to you too alabama... I told you I would tackle sprintf soon enough lol. Quote
Haunted Dawg Posted December 24, 2008 Posted December 24, 2008 Re: can someone tell me what I am doing wrong here Shaved, i would suggest spreading out your work like luke has done. It make's it easier for us to kind of read it. Quote
shaved92bravada Posted December 24, 2008 Author Posted December 24, 2008 Re: can someone tell me what I am doing wrong here Shaved, i would suggest spreading out your work like luke has done. It make's it easier for us to kind of read it. Yeah I plan on going back through and making everything legible for others to read. etc. I have been wanting usershops for awhile so I am using examples from the regular shops, itembuy, etc and making my own. Once I get it done I am thinking of having ya'll look over it privately and see what else I can do to secure it better, etc. I have figured out that the only way I am gonna learn is to try it. Error was, as I did not say yet... You were using back ticks around the `%d` - they need to be apostrophes. Table and row names = back ticks Anything else = apostrophe Of course, I may have forgot about something that will make this wrong, but for the most part, that is how it should be. I knew it was gonna be something simple like that.... but now that I know what to do it shall make it easier the next time. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.