Marsha Posted April 25, 2010 Share Posted April 25, 2010 Can anybody spot any big mistakes that would lead to my code not working? Have a good look please echo '<a href="' . $scripturl . '?action=downloads;sa=downfile&id=', $context['downloads_file']['ID_FILE'], '">', ($context['downloads_file']['fileurl'] == '' ? $context['downloads_file']['orginalfilename'] : $txt['downloads_app_download']), mysql_query("UPDATE smf_members SET karmaGood = karmaGood + 1 WHERE ID_MEMBER = $context[downloads_file][iD_MEMBER]"), '</a>'; Quote Link to comment Share on other sites More sharing options...
cags Posted April 25, 2010 Share Posted April 25, 2010 Firstly that is one stupidly long line of code. Secondly care to define doesn't work? The combination of concatenation and using the comma to pass extra parameters to echo is a little confusing, but should work. Having mysql_query in the middle of the line will output a 1 on success, but nothing otherwise. If ID_MEMBER is not an integer it will require quotes around it, but I'm guessing it is. The two dimensional array will not be accessed correctly in the string I don't believe. mysql_query("UPDATE smf_members SET karmaGood = karmaGood + 1 WHERE ID_MEMBER = $context[downloads_file][iD_MEMBER]") // should probably be mysql_query("UPDATE smf_members SET karmaGood = karmaGood + 1 WHERE ID_MEMBER = {$context['downloads_file']['ID_MEMBER']}") Quote Link to comment Share on other sites More sharing options...
Marsha Posted April 25, 2010 Author Share Posted April 25, 2010 Thats exactly why I didnt explain because you just sorted the problem straight away hehe. I knew it would be obvious. Thank you very much Quote Link to comment Share on other sites More sharing options...
cags Posted April 25, 2010 Share Posted April 25, 2010 Excellent. Can you please mark the topic as solved using the 'Mark Solved' button, which is located at the bottom left of the threads that you started. Quote Link to comment Share on other sites More sharing options...
Marsha Posted April 25, 2010 Author Share Posted April 25, 2010 I can indeed. Thanks again Quote Link to comment Share on other sites More sharing options...
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.