Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

uknown error

darthmoobeydarthmoobey Posts: 140Member
[code]
<?php
include('../php/config.php');
$connect=MYSQL_CONNECT($host,$user,$pw) or die ("<H3> Server Unreachable");
echo mysql_error();
MYSQL_SELECT_DB($db)or die ("

Database not Existant

");
echo mysql_error();

if($Submit="Submit"){ //Start of Submit Routine
$mysqlphysical=implode("|",$str,$dex,$stam);
$mysqlsocial=implode("|",$cha,$man,$app);
$mysqlmental=implode("|",$per,$int,$wit);
$mysqltalents=implode("|",$alert,$ath,$bra,$dod,$emp,$exp,$intim,$lead,$street,$sub);
$mysqlskills=implode("|",$anim,$cra,$dri,$etiq,$fire,$mel,$perf,$sec,$stea,$surv);
$mysqlknows=implode("|",$aca,$comp,$fin,$inve,$law,$ling,$med,$occ,$pol,$sci);

switch($gen){ //Start of Switch Routine checking Generation to Assign Blood Pool
case 15:
$blood="10";
break;
case 14:
$blood="10";
break;
case 13:
$blood="10";
break;
case 12:
$blood="11";
break;
case 11:
$blood="12";
break;
case 10:
$blood="13";
break;
case 9:
$blood="14";
break;
case 8:
$blood="15";
break;
case 7:
$blood="20";
break;
case 6:
$blood="30";
break;
case 5:
$blood="40";
break;
}//end of Case Switch for Determining Blood Pool

$r="INSERT INTO $table(CharName,Type,Gen,Sect,Concept,Sex,URL,Age1,Age2,Nature,Demeanor,Description,Physicals,Socials,Mentals,
Talents,Skills,Knowledges,Secondary,Backgrounds,Disciplines,MF,Willpower,Path,pathrate,Blood,Virtue1,
Virtue3,Virtue3,Equipment,Notes)
VALUES
($charname,$type,$gen,$sect,$concept,$sex,$url,$age1,$age2,$nature,$demeanor,$description,$mysqlphysical,
$mysqlsocial,$mysqlmental,$mysqltalents,$mysqlskills,$mysqlknows,$second,$backs,$powers,$merits,$willpower,
$path,$pathrate,$blood,$virtue1,$virtue2,$virtue3,$equipment,$notes)";

$result=mysql_query($r);
if($result){
echo"

Success!! Your Character was Successfully Created.


You may now close this window.
";
}
else{
echo"
Failure! ! Mysql Error Says:

".mysql_error()."
";
}
}//End of If Submit Statement
?>
[/code]

Hello everyone, thanks for the help on the previous questions I had, everything seems to be connecting now, but I seem to get a strange error message now.
Failure! ! Mysql Error Says:

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 ',,,,,,,,,,,, ,,,,,,,,,, ,,,,,,,)' at line 5

I have spoken to my webhosting Tech support personel and they assure me the problem is in my code. Unfortunately they have told me they do not have support as to tell me exactly where the error is, just told me my code is wrong. I have looked it over, and I can't seem to find the error. The funny thing is, the page loads entirely, except for the additional error message I have previously mentioned. When I submit my form, it adds the row, to the table, but no data gets transfered from my form to the table itself. If anyone has experienced a problem similiar to this, or can help, I appreciate your time.

the Darthmoob.

Comments

  • netgertnetgert Posts: 331Member
    : [code]
    : <?php
    : include('../php/config.php');
    : $connect=MYSQL_CONNECT($host,$user,$pw) or die ("<H3> Server Unreachable");
    : echo mysql_error();
    : MYSQL_SELECT_DB($db)or die ("

    Database not Existant

    ");
    : echo mysql_error();
    :
    : if($Submit="Submit"){ //Start of Submit Routine
    : $mysqlphysical=implode("|",$str,$dex,$stam);
    : $mysqlsocial=implode("|",$cha,$man,$app);
    : $mysqlmental=implode("|",$per,$int,$wit);
    : $mysqltalents=implode("|",$alert,$ath,$bra,$dod,$emp,$exp,$intim,$lead,$street,$sub);
    : $mysqlskills=implode("|",$anim,$cra,$dri,$etiq,$fire,$mel,$perf,$sec,$stea,$surv);
    : $mysqlknows=implode("|",$aca,$comp,$fin,$inve,$law,$ling,$med,$occ,$pol,$sci);
    :
    : switch($gen){ //Start of Switch Routine checking Generation to Assign Blood Pool
    : case 15:
    : $blood="10";
    : break;
    : case 14:
    : $blood="10";
    : break;
    : case 13:
    : $blood="10";
    : break;
    : case 12:
    : $blood="11";
    : break;
    : case 11:
    : $blood="12";
    : break;
    : case 10:
    : $blood="13";
    : break;
    : case 9:
    : $blood="14";
    : break;
    : case 8:
    : $blood="15";
    : break;
    : case 7:
    : $blood="20";
    : break;
    : case 6:
    : $blood="30";
    : break;
    : case 5:
    : $blood="40";
    : break;
    : }//end of Case Switch for Determining Blood Pool
    :
    : $r="INSERT INTO $table(CharName,Type,Gen,Sect,Concept,Sex,URL,Age1,Age2,Nature,Demeanor,Description,Physicals,Socials,Mentals,
    : Talents,Skills,Knowledges,Secondary,Backgrounds,Disciplines,MF,Willpower,Path,pathrate,Blood,Virtue1,
    : Virtue3,Virtue3,Equipment,Notes)
    : VALUES
    : ($charname,$type,$gen,$sect,$concept,$sex,$url,$age1,$age2,$nature,$demeanor,$description,$mysqlphysical,
    : $mysqlsocial,$mysqlmental,$mysqltalents,$mysqlskills,$mysqlknows,$second,$backs,$powers,$merits,$willpower,
    : $path,$pathrate,$blood,$virtue1,$virtue2,$virtue3,$equipment,$notes)";
    :
    : $result=mysql_query($r);
    : if($result){
    : echo"

    : Success!! Your Character was Successfully Created.


    : You may now close this window.
    :
    ";
    : }
    : else{
    : echo"
    Failure! ! Mysql Error Says:

    ".mysql_error()."
    ";
    : }
    : }//End of If Submit Statement
    : ?>
    : [/code]
    :
    : Hello everyone, thanks for the help on the previous questions I had, everything seems to be connecting now, but I seem to get a strange error message now.
    : Failure! ! Mysql Error Says:
    :
    : 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 ',,,,,,,,,,,, ,,,,,,,,,, ,,,,,,,)' at line 5
    :
    : I have spoken to my webhosting Tech support personel and they assure me the problem is in my code. Unfortunately they have told me they do not have support as to tell me exactly where the error is, just told me my code is wrong. I have looked it over, and I can't seem to find the error. The funny thing is, the page loads entirely, except for the additional error message I have previously mentioned. When I submit my form, it adds the row, to the table, but no data gets transfered from my form to the table itself. If anyone has experienced a problem similiar to this, or can help, I appreciate your time.
    :
    : the Darthmoob.
    :
    the problem might be here:
    [code]
    : $r="INSERT INTO $table(CharName,Type,Gen,Sect,Concept,Sex,URL,Age1,Age2,Nature,Demeanor,Description,Physicals,Socials,Mentals,
    : Talents,Skills,Knowledges,Secondary,Backgrounds,Disciplines,MF,Willpower,Path,pathrate,Blood,Virtue1,
    : Virtue3,Virtue3,Equipment,Notes)
    : VALUES
    : ($charname,$type,$gen,$sect,$concept,$sex,$url,$age1,$age2,$nature,$demeanor,$description,$mysqlphysical,
    : $mysqlsocial,$mysqlmental,$mysqltalents,$mysqlskills,$mysqlknows,$second,$backs,$powers,$merits,$willpower,
    : $path,$pathrate,$blood,$virtue1,$virtue2,$virtue3,$equipment,$notes)";
    [/code]
    replace it with
    [code]
    $r="INSERT INTO $table(CharName,Type,Gen,Sect,Concept,Sex,URL,Age1,Age2,Nature,Demeanor,Description,Physicals,Socials,Mentals,
    Talents,Skills,Knowledges,Secondary,Backgrounds,Disciplines,MF,Willpower,Path,pathrate,Blood,Virtue1,
    Virtue3,Virtue3,Equipment,Notes)
    VALUES
    ('$charname','$type','$gen','$sect','$concept','$sex','$url','$age1','$age2','$nature','$demeanor','$description','$mysqlphysical',
    '$mysqlsocial','$mysqlmental','$mysqltalents','$mysqlskills','$mysqlknows','$second','$backs','$powers','$merits','$willpower',
    '$path','$pathrate','$blood','$virtue1','$virtue2','$virtue3','$equipment','$notes')";
    [/code]
    just quote everything in VALUES()
    [hr][red][italic][b]N[/b][/red][blue]et[/blue][red][b]G[/b][/red][blue]ert[/italic][/blue][hr]

Sign In or Register to comment.