• Domingo 22 de Diciembre de 2024, 02:39

Autor Tema:  sintaxis incorrecta cerca de '0'. (severity 15)  (Leído 4503 veces)

marcelosf

  • Nuevo Miembro
  • *
  • Mensajes: 2
    • Ver Perfil
sintaxis incorrecta cerca de '0'. (severity 15)
« en: Sábado 21 de Marzo de 2015, 18:31 »
0
hola gente tengo una consulta si me pueden ayudar tengo un problema para ingresar datos en la tabla VI_CURR_INFO de un registro en el sql 2000!

el error es: Warning: mssql_query() [function.mssql-query]: message: L�nea 1: sintaxis incorrecta cerca de '0'. (severity 15) in C:\xampp\htdocs\enemymuweb\pgs\reg.php on line 109

Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampp\htdocs\enemymuweb\pgs\reg.php on line 109

Código: [Seleccionar]
<?php
echo "<script type=\"text/javascript\">document.getElementById(\"h4\").innerHTML = \"".menu_register."\"</script>
<input type='hidden' id='module_contet' value='"
.menu_register."'>";
$referal = NULL;
if (isset($_GET['r']))
{
$referal = $_GET['r'];
$result = mssql_query("select memb_name from memb_info where memb_name='$referal'");
if (mssql_num_rows($result) == 0)
{
$referal = NULL;
}
$myrow = mssql_fetch_array($result);
}
if (isset($_POST['register']))
{
$readrules = trim($_POST['readed']);
$login = trim($_POST['login']);
$nickname_ = trim(stripslashes($_POST['nickname_']));
$email = trim($_POST['email']);
$pwd = trim($_POST['pwd']);
$re_pass = trim($_POST['re_pass']);
$sq = trim($_POST['sq']);
$sa = trim($_POST['sa']);
$gen = trim($_POST['gen']);
$checktype = trim($_POST['checktype']);
$referal = trim(stripslashes($_POST['referal']));
$result = mssql_query("SELECT mail_addr FROM MEMB_INFO WHERE mail_addr='$email'"); 
$myrow = mssql_num_rows($result); 
$result2 = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login'"); 
$myrow2 = mssql_num_rows($result2);
$result3 = mssql_query("SELECT memb_name FROM MEMB_INFO WHERE memb_name='$nickname_'"); 
$myrow3 = mssql_num_rows($result3);
if ($_SESSION["imagestr"] != $checktype)
{
echo "<ul><li>Text from image are not inserted correct</li></ul>";
}
elseif ($readrules != "checked")
{
echo "<ul><li>".read_rules."</li></ul>";
}
elseif (empty($gen) || empty($login) || empty($nickname_) || empty($email) || empty($pwd) || empty($re_pass) || empty($sq) || empty($sa))

echo "<ul><li>".eror_complete_data."</li></ul>";
}
elseif (!preg_match('/^[a-z0-9]/i', $login) ||
 !preg_match('/^[a-z0-9]/i', $pwd) ||
 !preg_match('/^[a-z0-9]/i'$re_pass) ||
 !preg_match('/^[a-z0-9 !_+=-?.]/i'$sq) ||
 !preg_match('/^[a-z0-9 !_+=-?.]/i'$sa))

echo "<ul><li>".eror_string."</li></ul>";
}
elseif (!preg_match('/^['.$enemy["allow_char"].']/i', $nickname_))
{
echo "<ul><li>".eror_char_allow."</li></ul>";
}
elseif ($referal != NULL and !preg_match('/^['.$enemy["allow_char"].']/i', $referal))
{
echo "<ul><li>".eror_char_allow."</li></ul>";
}
elseif (!preg_match("/^[_a-z0-9\-\_]+(\.[_a-z0-9\-\_]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i"$email))
{
echo "<ul><li>".eror_email."</li></ul>";
}
elseif (strlen($login) < 4 || strlen($nickname_) < 4 || strlen($pwd) < 4)
{
echo "<ul><li>".eror_long_reg."</li></ul>";
}
elseif ($pwd != $re_pass)
{
echo "<ul><li>".pwd_not_coinc."</li></ul>";
}
elseif ($sq == $sa)
{
echo "<ul><li>".sec_q_difer."</li></ul>";

elseif ($myrow2 > 0)
{
echo "<ul><li>".login_exist."</li></ul>";
}
elseif ($myrow3 > 0)
{
echo "<ul><li>".nickname__exist."</li></ul>";
}
elseif ($myrow > 0)
{
echo "<ul><li>".email_exist."</li></ul>";
}
else
{
if ($enemy['md5'] == 1)
{
$md5_pwd = " [dbo].[EW_MD5]('$pwd', '$login')";
}
else
{
$md5_pwd = "'$pwd'";
}
$warehousenull = "0x";
for ($i=1;$i<=120;$i++)
{
$warehousenull .= $_SERVER['itemnull'];
}
if ($register['email_activate'] == 1) $mail_chek = 0;
else $mail_chek = 1;
$reg = mssql_query ("INSERT INTO MEMB_INFO (memb___id,memb_name,memb__pwd,sno__numb,mail_addr,fpas_ques,fpas_answ,bloc_code,ctl1_code,gen,mail_chek,webwarehouse) VALUES ('$login','$nickname_',$md5_pwd,'111111111111','$email','$sq','$sa','0','1','$gen',$mail_chek,$warehousenull);insert into EW_CREDITS (memb___id,credits) values ('$login',0)");
$reg = mssql_query("INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days )  VALUES ('2005','1',1234,'$login','$nickname_',1,'7','6','3','6','6','2003-11-23','0' ");
if ($referal != NULL)
{
$reg = mssql_query ("
declare @referal int,
@referal_2 int;
set @referal = (select memb_guid from memb_info where memb_name='
$referal');
set @referal_2 = (select memb_guid from memb_info where memb_name='
$nickname_');
print @referal;
print @referal_2;
INSERT INTO EW_REFERAL (id_username,id_username_ref,referal_level,charlevel_1,charlevel_2,charlevel_3,charlevel_4,charlevel_5,points,changedpoints) 
VALUES (@referal,@referal_2,1,'1/0/0','1/0/0','1/0/0','1/0/0','1/0/0',5,0)"
);
$search_ref = mssql_query("
declare @referal int;
set @referal = (select memb_guid from memb_info where memb_name='
$referal');
select id_username,id_username_ref from EW_REFERAL where id_username_ref=@referal"
);
if (mssql_num_rows($search_ref) > 0)
{
$myrow_search_ref = mssql_fetch_array($search_ref);
mssql_query("
declare @referal_2 int;
set @referal_2 = (select memb_guid from memb_info where memb_name='
$nickname_');
INSERT INTO EW_REFERAL (id_username,id_username_ref,referal_level,charlevel_1,charlevel_2,charlevel_3,charlevel_4,charlevel_5,points,changedpoints)
VALUES ('
$myrow_search_ref[id_username]',@referal_2,2,'1/0/0','1/0/0','1/0/0','1/0/0','1/0/0',3,0)");
$result_search_ref = mssql_query("select id_username,id_username_ref from EW_REFERAL where id_username_ref='$myrow_search_ref[id_username]'");
if (mssql_num_rows($result_search_ref) > 0)
{
$myrow_search_ref2 = mssql_fetch_array($result_search_ref);
mssql_query("
declare @referal_2 int;
set @referal_2 = (select memb_guid from memb_info where memb_name='
$nickname_');
INSERT INTO EW_REFERAL (id_username,id_username_ref,referal_level,charlevel_1,charlevel_2,charlevel_3,charlevel_4,charlevel_5,points,changedpoints) 
VALUES ('
$myrow_search_ref2[id_username]',@referal_2,3,'1/0/0','1/0/0','1/0/0','1/0/0','1/0/0',1,0)
update memb_info set referal_points=referal_points+1 where memb_guid='
$myrow_search_ref2[id_username]'");
}
}
}
if ($register['email_activate'] == 1)
{
$random = rand(00000,99999);
$encodeurl = bin2hex($email.$login.$random);
$body "Hello $login,\n\nThank you for registering at the $register[email_servername]. Before we can activate your account one last step must be taken to complete your registration.\n\nPlease note - you must complete this last step to become a registered member. You will only need to visit this URL once to activate your account.\n\nTo complete your registration, please visit this URL:\n <a href='http://".$_SERVER['SERVER_NAME'].$_SERVER['ROOT_FOLDER']."/?emw;Activate-Account;$login;$encodeurl'>http://".$_SERVER['SERVER_NAME'].$_SERVER['ROOT_FOLDER']."/?emw;Activate-Account;$login;$encodeurl</a>\n\nIf you are still having problems signing up please contact a member of our support staff at $enemy[support]\n\nAll the best,\n$register[email_servername]";
mail($email$register['email_subject'], $body"From: http://".$_SERVER['SERVER_NAME'].$_SERVER['ROOT_FOLDER']."/\nReply-To: $email\n");
mssql_query("insert into ew_activate (login,activationcode) values ('$login','$encodeurl')");
}
echo "<ul><li>".succes_acc_create."</li></ul>";
}
}
echo reg_unic;
?>

<form onsubmit="request('register','sh_','POST','getpage.php?cat=New-Registration'); return false;" id="register">
<table style="margin:0px auto;">
<tr>
<td><strong><? echo acc_id;?>:</strong></td>
<td><input name="login" type="text" size="30" maxlength="10" onblur="document.getElementById('login').innerHTML='<img alt=\'\' src=<? echo $_SERVER['IMAGES_HOST'];?>images/wait.gif>'; AjaxRegCheck(this.value,'login');"></td>
<td valign="top" width="150"><div id="login"></div></td>
</tr>
<tr>
<td valign="top"><strong><? echo nickname;?>:</strong></td>
<td><input name="nickname_" type="text" size="30" maxlength="10" onblur="document.getElementById('nickname_').innerHTML='<img alt=\'\' src=<? echo $_SERVER['IMAGES_HOST'];?>images/wait.gif>'; AjaxRegCheck(this.value,'nickname_');"><br><font color="#CC6600" size="1"><? echo acc_nickname;?></font></td>
<td valign="top" width="150"><div id="nickname_"></div></td>
</tr>
<tr>
<td><strong><? echo password;?>:</strong></td>
<td><input name="pwd" type="password" size="30" maxlength="10" onblur="document.getElementById('pwd').innerHTML='<img alt=\'\' src=<? echo $_SERVER['IMAGES_HOST'];?>images/wait.gif>'; AjaxRegCheck(this.value,'pwd');"></td>
<td valign="top" width="150"><div id="pwd"></div></td>
</tr>
<tr>
<td><strong><? echo re_pwd;?>:</strong></td>
<td><input name="re_pass" type="password" size="30" maxlength="10" onblur="document.getElementById('re_pass').innerHTML='<img alt=\'\' src=<? echo $_SERVER['IMAGES_HOST'];?>images/wait.gif>'; AjaxRegCheck(this.value,'re_pass');"></td>
<td valign="top" width="150"><div id="re_pass"></div></td>
</tr>
<tr>
<td valign="top"><strong><? echo email;?>:</strong></td>
<td><input name="email" type="text" size="30" maxlength="40" onblur="document.getElementById('email').innerHTML='<img alt=\'\' src=<? echo $_SERVER['IMAGES_HOST'];?>images/wait.gif>'; AjaxRegCheck(this.value,'email');">
<br><font color="#CC6600" size="1"><? echo email_example;?></font></td>
<td valign="top" width="150"><div id="email"></div></td>
</tr>
<tr>
<td><strong><? echo sec_q;?>:</strong></td>
<td><input name="sq" type="text" size="30" maxlength="40" onblur="document.getElementById('sq').innerHTML='<img alt=\'\' src=<? echo $_SERVER['IMAGES_HOST'];?>images/wait.gif>'; AjaxRegCheck(this.value,'sq');"></td>
<td valign="top" width="150"><div id="sq"></div></td>
</tr>
<tr>
<td><strong><? echo sec_a;?>:</strong></td>
<td><input name="sa" type="text" size="30" maxlength="40" onblur="document.getElementById('sa').innerHTML='<img alt=\'\' src=<? echo $_SERVER['IMAGES_HOST'];?>images/wait.gif>'; AjaxRegCheck(this.value,'sa');"></td>
<td valign="top" width="150"><div id="sa"></div></td>
</tr>
<tr>
<td><strong><? echo profile_gen;?></strong></td>
<td align="center"><input id="male" type="radio" name="gen" value="Male" checked><label for="male"><? echo profile_male;?></label>
<input id="female" type="radio" name="gen" value="Female"><label for="female"><? echo profile_female;?></label></td>
</tr>
<? if ($referal != NULL)
{
echo "<tr><td><strong>".referal_."</strong> ".$myrow['memb_name']."</td><td><input name='referal' type='hidden' value='".$myrow['memb_name']."'></td></tr>";
}?>
<tr>
<td><strong><? echo reg_insert_text;?></strong></td></tr><tr><td valign="middle">
<table><tr><td valign="middle"><div onmouseover='return overlib("Refresh");' onmouseout='return nd();' class="refresh" onclick="refreshimage('<? echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['ROOT_FOLDER']."/";?>Image-verify','image');"></div></td><td><p id="image"><img alt='' src="<? echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['ROOT_FOLDER']."/";?>Image-verify" border="0"></p></td></tr></table></td><td valign="middle">
<input name="checktype" id="imgvalue" size="15" maxlength="10" type="text" onblur="document.getElementById('checktype').innerHTML='<img alt= alt=\'\' src=<? echo $_SERVER['IMAGES_HOST'];?>images/wait.gif>'; AjaxRegCheck(this.value,'checktype');"></td>
<td valign="center" width="150"><div id="checktype"></div></td>
</tr>
<tr>
<td colspan="2"><? echo read_rules;?><br>
<input id="check" type="checkbox" name="readed" value="checked"><label for="check"><? echo read_rules_yes;?></label>
<p align="center"><input name="register" type="submit" value="<? echo menu_register;?>"></p></td>
</tr>
</td></tr></table>
</form>
Subido en subir imagenes

marcelosf

  • Nuevo Miembro
  • *
  • Mensajes: 2
    • Ver Perfil
Re:sintaxis incorrecta cerca de '0'. (severity 15)
« Respuesta #1 en: Sábado 21 de Marzo de 2015, 19:01 »
0
ya lo solucione me falto el ultimo parentesis!!!

mssql_query("INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days )  VALUES ('2005','1',1234,'$login','$nickname_',1,'7','6','3','6','6','2003-11-23','0') ");