<?php require_once("../zapytania.php"); mysql_connect ("mysql3.superhost.pl","sh178151_admin","xxx"); //łącze z bazą ("serwer bazy","użytkownik","hasło") function emotki($string) { $emotikony = array(":D" => "http://firegifts.pl/images/emoticons/smilie5.gif",":)" => "http://firegifts.pl/images/emoticons/wink.gif", "lol2" => "http://emotikona.pl/emotikony/pic/01icon_lol2.gif", ":(" => "http://emotikona.pl/emotikony/pic/0sad.gif", ":P" => "http://emotikona.pl/emotikony/pic/0tongue.gif", "kurwa" => "http://firegifts.pl/images/emoticons/censored.gif", "huj" => "http://firegifts.pl/images/emoticons/censored.gif", "google" => "http://emotikona.pl/emotikony/pic/14icon_google.gif"); foreach($emotikony as $tekst => $grafika) $string = str_replace($tekst,'<img src="'.$grafika.'" />',$string); return $string; } { //Definicja zmiennych $ip = $_SERVER['REMOTE_ADDR']; //Wykonujemy zapytanie importujące zdefiniowane dane mysql_query ("INSERT INTO `posty` (`login`, `tresc`, `data`, `ip`) VALUES('$login', '$tresc', '$data', '$ip')"); //No i przenosimy użytkownika z powrotem do shoutboxa } else { //Pobieramy dane z bazy //Początek struktury tabeli //Pętla do wyświetlenia wszystkich wpisów .'<b> '); .$shout['tresc'] //wyświetlamy treść .'<br/><span class="data">' .$shout['data'] //wyświetlamy datę .'</span> '); if (($data['admin']) == 1){ { switch ($_GET['akcja']) { case 'spamer': break; } } ?><a href="/chat/index.php?akcja=usun&id=<? echo''.$shout['id'].''; ?> "> <span style="color:red;"><b>X</b></a></span><? } if (($data['admin']) == 1){ { switch ($_GET['akcja']) { case 'spamer': mysql_query("INSERT INTO `users` (`spamer`) VALUES('1') WHERE '".$shout['login']."' = '".$data['login']."'") or die(mysql_error()); break; } } ?><a href="/chat/index.php?akcja=spamer&login=<? echo''.$shout['login'].''; ?> "> <span style="color:green;"><b>S</b></a></span><? } } // //Koniec struktury tabeli } //print_r($_SERVER); ?> <form action="" method="POST" id="shoutbox"> <?php require_once("../zapytania.php"); echo'<input type="hidden" name="login" value="'.$data['login'].'" />'; ?><br/> Treść: <input type="text" name="tresc" maxlength="125" /> <button type="submit" name="wyslij">Napisz</button> </form>
Błąd:
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 'WHERE 'Bartek4175' = 'Bartek4175'' at line 1