Jump to content
MakeWebGames

Recommended Posts

Posted

in all my files that send events out eg when you buy something from the market or attack someone i get this error

QUERY ERROR: Column count doesn't match value count at row 1

Query was INSERT INTO events VALUES('',3,UNIX_TIMESTAMP(),0,

can someone help please?

Posted

Re: Error with coding need help please

i didnt edit the table heres the event function line i think i need to change

$db->query("INSERT INTO events VALUES('',$userid,UNIX_TIMESTAMP(),0,'$text')");

Posted

Re: Error with coding need help please

 

i didnt edit the table heres the event function line i think i need to change

$db->query("INSERT INTO events VALUES('',$userid,UNIX_TIMESTAMP(),0,'$text')");

Have you cleaned the text?... $db->escape($text) o.o

Posted

Re: Error with coding need help please

ok this is my whole event function

function event_add($userid,$text,$connection=0)

{

global $db;

$text=mysql_escape($text);

$db->query("INSERT INTO events VALUES('',3,UNIX_TIMESTAMP(),0,'$text')");

$db->query("UPDATE users SET new_events=new_events+1 WHERE userid={$userid}");

return 1;

Posted

Re: Error with coding need help please

function event_add($userid,$text,$connection=0)

{

global $db;

$text=mysql_escape($text);

$db->query("INSERT INTO events VALUES('',$userid,UNIX_TIMESTAMP(),0,'$text')");

$db->query("UPDATE users SET new_events=new_events+1 WHERE userid={$userid}");

return 1;

}

this is my events function...

 

go into phpmyadmin and check the events table you should have

these fields

`evID` int(11) NOT NULL auto_increment,

`evUSER` int(11) NOT NULL default '0',

`evTIME` int(11) NOT NULL default '0',

`evREAD` int(11) NOT NULL default '0',

`evTEXT` text NOT NULL,

Posted

Re: Error with coding need help please

if you don't have those five events then delete the events table and run this in the sql query...

CREATE TABLE IF NOT EXISTS `events` (

`evID` int(11) NOT NULL auto_increment,

`evUSER` int(11) NOT NULL default '0',

`evTIME` int(11) NOT NULL default '0',

`evREAD` int(11) NOT NULL default '0',

`evTEXT` text NOT NULL,

PRIMARY KEY (`evID`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

Posted

Re: Error with coding need help please

i still get this error with your function

QUERY ERROR: Column count doesn't match value count at row 1

Query was INSERT INTO events VALUES('',550,UNIX_TIMESTAMP(),0

Posted

Re: Error with coding need help please

did you go into phpmyadmin and check the events table...

thats where your problem is you've either added an extra field or deleted one...

check the table there should be 5 fields if not delete the events table and run that query i gave you...

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.   Paste as plain text instead

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