Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.