d22552000 Posted August 12, 2007 Share Posted August 12, 2007 function putcombo($combo,$outcome) { $g_link = mysql_connect( '127.0.0.1', 'root', '') or die('Could not connect to server.' ); mysql_select_db('roleplay', $g_link) or die('Could not select database.'); $sql = " INSERT INTO `roleplay`.`roll` ( `ID` , `combo` , `outcome` , `when` ) VALUES ( NULL , '" . $combo . "', '" . $outcome . "', NOW( ) ) "; $result = mysql_query($sql); mysql_close($g_link); } I feed it ("1 + 1",2); but in PHPMYADMIN no rows have been added. My combo row is a 255 size varchar and my outcome row is a 31 size int EDIT: it was the size of my MYSQL combo table needing to be 1023 bytes long. Quote Link to comment https://forums.phpfreaks.com/topic/64563-solved-mysql-wont-do-nothing/ Share on other sites More sharing options...
NArc0t1c Posted August 12, 2007 Share Posted August 12, 2007 Try this, function putcombo($combo,$outcome) { $g_link = mysql_connect('localhost', 'root', '') or die('Could not connect to server.' ); mysql_select_db('roleplay', $g_link) or die('Could not select database.'); $sql = "INSERT INTO `roleplay`.`roll` VALUES (NULL , '" . $combo . "', '" . $outcome . "', time())"; $result = mysql_query($sql);         mysql_close($g_link); } I changed 127.0.0.1 to avoid the loopback. Quote Link to comment https://forums.phpfreaks.com/topic/64563-solved-mysql-wont-do-nothing/#findComment-321832 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.