Jump to content

[SOLVED] Mysql won't do nothing...


d22552000

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/64563-solved-mysql-wont-do-nothing/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.