fingers Posted October 30, 2014 Share Posted October 30, 2014 Yo Larry For some reason my script only works when I quote the integer i.e '%d' $q = sprintf("INSERT INTO tasks (parent_id, task) VALUES ('%d', '%s')", $parent_id,mysqli_real_escape_string($dbc, strip_tags($_POST['task']))); If I don't do this the task does not get added. Any ideas? PHPStorm hinted that I should do this. I'm using - Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15 Thanks for the great work Gary Link to comment Share on other sites More sharing options...
Larry Posted October 31, 2014 Share Posted October 31, 2014 Thanks for the nice words, Gary. Quoting a number shouldn't be necessary, however. What's your table definition look like? Link to comment Share on other sites More sharing options...
fingers Posted November 1, 2014 Author Share Posted November 1, 2014 The column is defined as int but it's ok it seems to have fixed itself and it now works. Whenever I post in here this always happens! Outstanding service! Link to comment Share on other sites More sharing options...
Larry Posted November 6, 2014 Share Posted November 6, 2014 Glad to hear it and thanks for letting me know. Thanks, too, for the nice words! Glad the forum has been useful! Link to comment Share on other sites More sharing options...
Recommended Posts