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); Link to comment https://forums.phpfreaks.com/topic/81180-solved-parse-database-result-obvious-but-im-missing-it/ 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? Link to comment https://forums.phpfreaks.com/topic/81180-solved-parse-database-result-obvious-but-im-missing-it/#findComment-411942 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. Link to comment https://forums.phpfreaks.com/topic/81180-solved-parse-database-result-obvious-but-im-missing-it/#findComment-411948 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... Link to comment https://forums.phpfreaks.com/topic/81180-solved-parse-database-result-obvious-but-im-missing-it/#findComment-411965 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... Link to comment https://forums.phpfreaks.com/topic/81180-solved-parse-database-result-obvious-but-im-missing-it/#findComment-411974 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 Link to comment https://forums.phpfreaks.com/topic/81180-solved-parse-database-result-obvious-but-im-missing-it/#findComment-411978 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.