phpbar.de logo

Mailinglisten-Archive

[php] Insert into ?

[php] Insert into ?

Robert Backhaus php-liste_(at)_online.de
19 Feb 2001 11:33:07 +0100


Hallo Liste ,

das script soll per webinterface ermöglichen, daten eines clanfights in
die db einzutragen. allerdings werden nur die wins und die loses
generiert und aufgenommen. die restlichen daten verschwinden ohne
fehlermeldung im nirvana 


---- schnipp-------
				
                echo "<link rel=stylesheet type=\"text/css\"
href=\"style.css\"></head>\n";
                echo "<body bgcolor=\"#4000FF\" text=\"#000000\">\n";
                
                if (!$vst)
                 {
                 echo "<center><h2>Datenmaske für Clanwar</h2>\n";
                echo "</center>\n";
                echo "<form action=\"$php_self?m=war\"
method=\"post\">\n";
                echo "<input type=\"hidden\" name=\"vst\"
value=\"1\">\n";
                echo "<center><table bgcolor=\"#1386FF\" width=100%
align=center cellpadding=4 cellspacing=4 marginwidth=0 border=0 >\n";
               	echo "<tr><td align=right>Datum:</td><td><input
name=\"datum\" size=\"20\"></td></tr>\n";
                echo "<tr><td align=right>Modus:</td><td><input
name=modus type=\"radio\" value=\"Ass\" >Ass<input name=modus
type=\"radio\" value=\"CTF\" >CTF<input name=modus type=\"radio\"
value=\"DM\" >DM<input name=modus type=\"radio\" value=\"TDM\"
>TDM<input name=modus type=\"radio\" value=\"DOM\" >DOM</td></tr>\n";
                echo "<tr><td align=right>Clankürzel</td><td><input
name=\"clan\" size=\"20\"></td></tr>\n";
                echo "<tr><td align=right>Clanurl</td><td><input
name=\"clanurl\" size=\"20\">&nbsp; bitte mit http://</td></tr>\n";
                echo "<tr><td align=right>Score -NXK-:</td><td><input
name=\"scorenxk\" size=\"20\"></td></tr>\n";
                echo "<tr><td align=right>Score Gegner</td><td><input
name=\"scoreclan\" size=\"20\"></td></tr>\n";
                echo "<tr><td align=right>Comment:</td><td><input
name=\"comment\" size=\"20\"></td></tr>\n";
                $q1 = "SELECT nick,id FROM members ORDER BY id ASC";
                  $r1 = mysql_query($q1);
                  echo "<tr><td align=right>Member</td><td> <select
name=\"login\">";
                  while(list($nick, $id) = mysql_fetch_row($r1))
                    {
                     echo "<option value=\"$id\"> $nick\n";
                    }
                  echo "</select></td><tr>";
                echo "<tr><td align=right>Passwort:</td><td><input
type=\"password\" name=\"pw\"></td></tr>\n";
                echo "<tr><td colspan=2 align=center><input
type=\"submit\" value=\"Daten Aktualisieren\"></td></tr>\n";
                echo "</form>\n";
                break;
                 }
       else
         {

            $qauth = "SELECT password FROM members where id = $login";
            $rauth = mysql_query($qauth);
            list($password) = mysql_fetch_row($rauth);
                 if ($pw == $password)
            	{
            	if ($scorenxk > $scoreclan)
            		{
                      $qu = "SELECT win FROM wars";
                      $r = mysql_query($qu);
                      list($win) = mysql_fetch_row($r);
                      $win++;
                      $qu = "UPDATE wars SET win=$win";
                      mysql_query($qu);
                      $e2=mysql_error();
                      echo $e2;
                      }
		else
		     {
                      $qu = "SELECT lose FROM wars ";
                      $r = mysql_query($qu);
                      list($lose) = mysql_fetch_row($r);
                      $lose++;
                      $qu = "UPDATE wars SET lose=$lose ";
                      mysql_query($qu);
                      $e2=mysql_error();
                      echo $e2;
                      }
                      _(at)_mysql_query("INSERT INTO $clan (id , datum ,
clan, clanurl, modus, scorenxk, scoreclan, comment) VALUES('', '$datum',
'$clan', '$clanurl', '$modus', '$scorenxk', '$scoreclan', '$comment')");
                      echo "
                      passt\n"; 
                      break;	
                }
              else
               {
                echo "Falsches Passwort!\n";
                break;
               }
               }
              break;	

------schnapp-----

danke für eure hilfe

robert backhaus


-- 
Robert Backhaus
Westbahnhofstr. 3
07745 Jena
Germany

Phone.: +49 3641 617843

http://www.linux-secure.de
http://www.linuxboard.de




php::bar PHP Wiki   -   Listenarchive