Any ideas to why i get this error?


Question:
i get this error when i execute the PHP here there is no problem entering data its only when the submit button is pressed that the error happens.Please help Im stuck and a newbie in php!

New member registration
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1, 0, 0, 0, '2007-01-19 22:12:42', 0, '2007-01-19 22:12:42', 'n

<?php
session_start();
session_register("sess_data");
session_register("ref");
session_register("sess_name");
session_register("sess_passwd"...
include("vars.php");
include("headfoot.php");
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);
if ($_SERVER['REMOTE_ADDR']=='127... {$_SERVER['REMOTE_ADDR']=$_SER...
if ($_GET['ref'] && is_numeric($_GET['ref'])) {
$rck = mysql_query("SELECT * FROM user WHERE id=$_GET[ref] && status='Active'");
if (mysql_num_rows($rck) != 0) {
$acctype = mysql_result($rck, 0, "acctype");
$creditme = mysql_result(mysql_query("SELE... rpgebonus FROM acctype WHERE id=$acctype"), 0);
$_SESSION['ref'] = $_GET['ref'];
$ipis = $_SERVER['REMOTE_ADDR'];
$validip = 'no';
if (is_string($ipis) && ereg('^([0-9]{1,3})\.([0-9]{1,... . '([0-9]{1,3})\.([0-9]{1,3})$', $ipis, $sect)) {
if ($sect[1] <= 255 && $sect[2] <= 255 && $sect[3] <= 255 && $sect[4] <= 255) {
$validip = 'yes';
$recip = "$sect[1].$sect[2].$sect[3]";
} else {
$validip = 'no';
}
} else {
$validip = 'no';
}
if ($validip == 'yes' && $recip != "" && $creditme > 0) {
$ressu = mysql_query("SELECT * FROM referstats WHERE usrid=$_GET[ref] && refip='$recip'") or die (mysql_error());
if (mysql_num_rows($ressu) == 0) {
$todayis = date("Y-m-d");
$timeis = date("H:i:s");
$htt_ref = $_SERVER['HTTP_REFERRER'];
if ($htt_ref == "") {
$htt_ref = "Direct Request/Referring Info Blocked";
}
$updateit = mysql_query("INSERT INTO referstats (usrid, orgip, refip, cdate, ctime, httpref, browser) VALUES ($_GET[ref], '$ipis', '$recip', '$todayis', '$timeis', '$htt_ref', '".$_SERVER['HTTP_USER_AGENT']... or die (mysql_error());
if ($creditme > 0) { $swe = mysql_query("UPDATE user SET credits=credits+$creditme, rpage_credits=rpage_credits+$c... lifetime_credits=lifetime_cred... WHERE id=$_GET[ref]") or die (mysql_error()); $iearned_n = "I just earned <b>$creditme</b> credit(s) for showing you this page!"; }
}
}
} else {
$_GET['ref'] = 0;
}
}
uheader();
include("main_page.php");
ufooter();
mysql_close;
exit;
?>

HERES THE BATABASE sqlinfo

CREATE TABLE 7stat (
usrid int(11) default NULL,
date date default NULL,
time time default '00:00:00',
pg_views int(11) default '0',
num float default NULL,
received_pay char(3) default 'no'
) TYPE=MyISAM;

CREATE TABLE 7statsite (
siteid int(11) default NULL,
date date default NULL,
last_hit_time time default '00:00:00',
num int(11) default NULL
) TYPE=MyISAM;

CREATE TABLE abuse (
id int(11) NOT NULL auto_increment,
siteid int(11) default NULL,
usrid int(11) default NULL,
text text,
date timestamp(14) NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE acctype (
id int(11) NOT NULL auto_increment,
name varchar(100) default NULL,
descr text,
ratemin float default '0',
ratemax float default '0',
cost float default '0',
cashout float default '0',
commissions float default '0',
min_sites int(11) default '0',
monthly_bonus float default '0',
upg_time int(11) default '0',
rpgebonus float default '0',
rbonuses varchar(100) default NULL,
levels varchar(100) default NULL,
ptc_levels varchar(100) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

INSERT INTO acctype VALUES (1, 'Free Member', 'Free account', '0.5', '0.8', '0', '15', '0.1', 10, '0', 0, 0.5, '100,50,30,20,10', '20,10,5,5,5', '20,10,5,5,5');
INSERT INTO acctype VALUES (2, 'Upgraded Member', '1:1 Upgraded Membership<br>\r\n1:1 Surf Ratio!<br>Purchase 1 Upgrade Credit and automatically upgrade to 1:1 Upgraded Status!', '0.8', '1', '10', '10', '0.1', 100, '1000', 365, 1, '100,50,30,20,10', '30,20,10,5,5', '20,10,5,5,5');

CREATE TABLE ad_info (
ad_id int(11) NOT NULL auto_increment,
ad_name varchar(100) NOT NULL default '',
type int(11) NOT NULL default '0',
link_url text NOT NULL,
banner_url text NOT NULL,
h int(11) NOT NULL default '0',
w int(11) NOT NULL default '0',
alt varchar(100) NOT NULL default '',
bottom_text varchar(100) NOT NULL default '',
mouse_text varchar(100) NOT NULL default '',
html text NOT NULL,
num_allow_exp int(11) NOT NULL default '0',
num_exp int(11) NOT NULL default '0',
num_clicks int(11) NOT NULL default '0',
prob int(11) NOT NULL default '0',
win int(11) NOT NULL default '0',
adv_user int(11) default '0',
date varchar(10) NOT NULL default '',
PRIMARY KEY (ad_id)
) TYPE=MyISAM;

CREATE TABLE admin (
field varchar(20) default NULL,
value varchar(255) default NULL
) TYPE=MyISAM;

INSERT INTO admin VALUES ('login', 'admin');
INSERT INTO admin VALUES ('email', NULL);
INSERT INTO admin VALUES ('passwd', 'admin');
INSERT INTO admin VALUES ('lastaccess', '0');
INSERT INTO admin VALUES ('lastac', '0');
INSERT INTO admin VALUES ('lastacip', '0.0.0.0');
INSERT INTO admin VALUES ('lastip', '0.0.0.0');
INSERT INTO admin VALUES ('lstcrn', '0000-00-00');

CREATE TABLE adminprops (
field varchar(6) default NULL,
value float default '0'
) TYPE=MyISAM;

INSERT INTO adminprops VALUES ('inibon', '1000');
INSERT INTO adminprops VALUES ('insbon', '1');
INSERT INTO adminprops VALUES ('reftim', '6');
INSERT INTO adminprops VALUES ('negact', '0');
INSERT INTO adminprops VALUES ('contex', '5');
INSERT INTO adminprops VALUES ('contey', '2');
INSERT INTO adminprops VALUES ('contcx', '6');
INSERT INTO adminprops VALUES ('contcy', '0.005');
INSERT INTO adminprops VALUES ('surplu', '0');
INSERT INTO adminprops VALUES ('csurpl', '0');
INSERT INTO adminprops VALUES ('sharec', '10');
INSERT INTO adminprops VALUES ('sharea', '1000');
INSERT INTO adminprops VALUES ('inact', '180');

CREATE TABLE banned_emails (
id int(11) NOT NULL auto_increment,
value varchar(255) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

INSERT INTO banned_emails VALUES (1, '*@mail.com');

CREATE TABLE banned_ipadds (
id int(11) NOT NULL auto_increment,
value varchar(15) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE banned_sites (
id int(11) NOT NULL auto_increment,
domain varchar(255) default NULL,
type char(1) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE banner (
id int(11) NOT NULL auto_increment,
imgurl varchar(255) default NULL,
widtheight varchar(24) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE cashout_history (
id int(11) NOT NULL auto_increment,
usrid int(11) default '0',
amount float(10,2) default '0.00',
descr varchar(100) default NULL,
pay_merch varchar(50) default NULL,
paid_to varchar(150) default NULL,
cdate date default '0000-00-00',
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE comission_history (
id int(11) NOT NULL auto_increment,
paid_to int(11) default '0',
usrid int(11) default '0',
wasfor varchar(100) default NULL,
amount float(11,2) default '0.00',
vdate date default '0000-00-00',
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE faq (
id int(11) NOT NULL auto_increment,
quest text,
answ text,
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE gp_info (
gp_id int(11) NOT NULL auto_increment,
gid int(11) NOT NULL default '0',
ad_id int(11) NOT NULL default '0',
ad_prob int(11) NOT NULL default '0',
PRIMARY KEY (gp_id)
) TYPE=MyISAM;

CREATE TABLE gp_name (
id int(11) NOT NULL auto_increment,
gp_name varchar(100) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE html (
type varchar(5) default NULL,
content text
) TYPE=MyISAM;

INSERT INTO html VALUES ('terms', 'Enter your site terms and conditions here');
INSERT INTO html VALUES ('priva', 'Enter your site privacy-policy here');
INSERT INTO html VALUES ('1page', 'Enter you program details here (signup bonuses, referral earnings etc.. etc..).');

CREATE TABLE investment_history (
id int(11) NOT NULL auto_increment,
usrid int(11) default '0',
amount float(10,2) default '0.00',
descr varchar(100) default NULL,
is_from varchar(50) default '0',
processor varchar(100) default NULL,
adate date default '0000-00-00',
expired char(3) default 'no',
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE member_refs (
mem_id int(11) NOT NULL default '0',
ref_id int(11) NOT NULL default '0',
UNIQUE KEY uniqueness (mem_id,ref_id),
KEY usersid (mem_id),
KEY upline (ref_id)
) TYPE=MyISAM;

CREATE TABLE merchant_codes (
id int(11) NOT NULL auto_increment,
name varchar(100) default NULL,
code text,
PRIMARY KEY (id)
) TYPE=MyISAM;

INSERT INTO merchant_codes VALUES (1, 'PayPal', 'Code here');
INSERT INTO merchant_codes VALUES (2, 'E-Gold', 'E-Gold Code');
INSERT INTO merchant_codes VALUES (3, 'StormPay', 'Code with Substitutions here [user] [cost] etc...');

CREATE TABLE monthly_stats (
id int(11) NOT NULL auto_increment,
usrid int(11) default '0',
days_paid_roi int(11) default '0',
past_earnings float(10,5) default '0.00000',
roi_earned float(10,4) default '0.0000',
coms_earned float(10,4) default '0.0000',
sbcash_earned float(10,5) default '0.00000',
ptc_cash_e float(10,4) default '0.0000',
refptc_cash float(10,4) default '0.0000',
misc_earned float(10,4) default '0.0000',
tot_owed float(10,5) default '0.00000',
paid_out float(10,3) default '0.000',
monthis int(2) default '0',
yearis int(4) default '0',
this_month date default '0000-00-00',
month_transfer char(3) default 'no',
earn_pay char(3) default 'no',
paidout char(3) default 'no',
finalized char(3) default 'no',
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE other_history (
id int(11) NOT NULL auto_increment,
usrid int(11) default '0',
amount float(10,2) default '0.00',
descr varchar(100) default NULL,
is_from varchar(50) default '0',
adate date default '0000-00-00',
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE ptc_orders (
ptcid int(11) NOT NULL auto_increment,
type enum('banner','text') NOT NULL default 'banner',
type2 enum('cash','credit') NOT NULL default 'cash',
userid int(11) default NULL,
linkid varchar(25) default NULL,
banurl varchar(200) default NULL,
linkurl text NOT NULL,
linktxt text,
clicks_remain int(11) NOT NULL default '0',
amt_sent int(11) NOT NULL default '0',
date_sent date default '0000-00-00',
date_done date default '0000-00-00',
cash_click float default '0',
credit_click float default '0',
adtimer int(5) NOT NULL default '0',
day_lock int(5) NOT NULL default '0',
PRIMARY KEY (ptcid)
) TYPE=MyISAM;

CREATE TABLE ptc_tracking (
userid int(11) default NULL,
banlinkid varchar(25) default NULL,
cdate date default NULL
) TYPE=MyISAM;

CREATE TABLE referstats (
id int(11) NOT NULL auto_increment,
usrid int(11) default '0',
orgip varchar(15) default NULL,
refip varchar(15) default NULL,
httpref varchar(255) default NULL,
browser varchar(255) default NULL,
cdate date default NULL,
ctime time default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE sellcredit (
id int(11) NOT NULL auto_increment,
name varchar(255) default NULL,
descr text,
cost float default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;

INSERT INTO sellcredit VALUES (1, '1000 Site Credits', '1000 Site Credits', '5');

CREATE TABLE site (
id int(11) NOT NULL auto_increment,
usrid int(11) default NULL,
name varchar(255) default NULL,
url varchar(255) default NULL,
lang varchar(30) default NULL,
state varchar(30) default NULL,
credits float default '0',
totalhits int(11) default '0',
hitslastmail int(11) default '0',
hour varchar(13) default '0',
cph int(11) default '0',
cth int(11) default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE tads (
id int(11) NOT NULL auto_increment,
text text,
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE user (
id int(11) NOT NULL auto_increment,
name varchar(100) default NULL,
email varchar(100) default NULL,
passwd varchar(20) default NULL,
pay_to int(11) default '0',
payout_address varchar(150) default NULL,
ref int(11) default '0',
invested float(10,2) default '0.00',
acctype int(11) default NULL,
credits float default '0',
roi_cash float(10,4) default '0.0000',
cshfrmallrefs float(10,5) default '0.00000',
lifetime_cash float(10,3) default '0.000',
lifetime_paid float(10,2) default '0.00',
lifetot_roi float(10,5) default '0.00000',
joindate datetime default NULL,
lastmail date default '0000-00-00',
minmax int(11) default NULL,
crdsfrmallrefs float default '0',
rbon_credits float default '0',
rpage_credits float default '0',
lifetime_credits float default '0',
lifetime_pages int(11) default '0',
sb_credits float default '0',
sb_cash float(10,5) default '0.00000',
ptc_clicks int(11) default '0',
ptc_crds float default '0',
ptc_cash float default '0',
lastroi date default '0000-00-00',
lastaccess datetime default NULL,
lastsurfed datetime default '0000-00-00 00:00:00',
upgrade_ends date default NULL,
premregdate date default '0000-00-00',
premmp int(11) default '0',
toref float default '0',
cshtoref float(10,5) default '0.00000',
commstoref float(10,4) default '0.0000',
allow_contact char(3) default 'yes',
status varchar(20) default NULL,
ip_address varchar(15) default NULL,
ac int(11) default '0',
PRIMARY KEY (id),
UNIQUE KEY email (email)
) TYPE=MyISAM;


PLEASE HELP

Answer:
First, there's no need to post this much code in a question. Second, preview your question before you post; you would have seen that key portions of your code are being truncated by AnswersRoom.coms.

In the future, please post your code to a Web site as a text file.

Third, don't post piles of extraneous information. Your entire database schema is clearly not needed to resolve one SQL error in the referstats table.

The problem is clearly with your insert. According to the error, you are trying to pass at least eight parameters to the insert query, but in truth there are only seven fields specified in the insert order.

I can't actually verify the problem because that line was one of the ones that was truncated.

You should delete this question, copy ONLY your PHP code to a text file, post ONLY the PHP code to the server, and ask a new question, with a link to the code.
because your computer hates you
HooooLeeeey Sheet man! You missed the most important figure. What about the ;)@inurface!= ..l.. ??
I would break this down and find your error. Run each CREATE separately, run each INSERT separately.

Is there a reason you are putting single quotes around some values (even numbers) and not others? For the sake of consistency, you might want to consider putting single quotes around all your values.
More Questions & Answers...
  • I am an Indonesian.i read email by www.time4ptr.com, its true earn money or not.please answer me.?
  • Help with employees rights when buisness is sold?
  • Will richmails pay after earning the minimum payout?
  • What is the best camping location in Second Life?
  • Why does the show Survivor,still only give a million dollars?
  • HELP! 3 Finance Homework Problems - Annual rate of increase?
  • What's 400 million divided by 50 thousand?
  • Any one interested to learn How to trade stock with free mentoring and use firm's capital?
  • The questions and answers post by the user, for information only, AnswersRoom.com does not guarantee the right
    Copyright © 2007 AnswersRoom.com -   Terms of Use -   Contact us

    Hot Topic