amites Posted December 11, 2007 Share Posted December 11, 2007 Hello, I'm working on a script to verify results and having trouble pulling the data out of a field the problem I'm having is gathering values from this query, I know it's something stupid and obvious after I racked my blain for hours last night trying different things I'm not seeing it this morning either... any suggestions are appreciated $result_event = doQuery("SELECT Cost, firstTik, reservedTik FROM " . HC_TblPrefix . "events WHERE PkID='%s'", mysql_real_escape_string($p->ipn_data['item_number'])); $holder = $p->ipn_data['quantity'] * mysql_result($result_event,0); Quote Link to comment Share on other sites More sharing options...
samona Posted December 11, 2007 Share Posted December 11, 2007 Does it work when you don't use the mysql_real_escape_string() function? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 11, 2007 Share Posted December 11, 2007 You are using % but not using LIKE WHERE PkID='%s' % is a wild character and needs LIKE to work. Quote Link to comment Share on other sites More sharing options...
amites Posted December 11, 2007 Author Share Posted December 11, 2007 not familiar with real_escape_string have to try that one next, the %s is out of the manual as a wildcard to be swapped out with the mysql_real_escape_string which cleans up entries to avoid malicious code... I verified $p->ipn_data['item_number'] has a value but nothing I'm pulling from the DB has a value, tried a number of different methods for fetching values from the data, starting to question myself on this one... Quote Link to comment Share on other sites More sharing options...
revraz Posted December 11, 2007 Share Posted December 11, 2007 You didn't read what I posted. the %s is out of the manual as a wildcard to be swapped out with the mysql_real_escape_string which cleans up entries to avoid malicious code... Quote Link to comment Share on other sites More sharing options...
amites Posted December 11, 2007 Author Share Posted December 11, 2007 your right I didn't, think I'm caffeine deprived, pulled the real_escape_string out and it worked, would rather use it, though right now I'd rather see it working that perfect 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.