Mam coś w rodzaju takiego czatu lecz z komputerem. Cała rozmowa jest dodawana do bazy a gdy ją chce wyświetlić wyrzuca błędy. Oto kod:
<head> <style> #ramka {width: 500px; height: 350; border: 1px solid black;} </style> </head> <? $chat_file = 'chat.ini'; { $i = 0; while($i<$count_tab) { $i++; if($klucz == true) { $found_v = $baza_val[$klucz]; } } { $found_v = $baza['alternative']; } $odp = $found_v[$rand]; include('baza.php'); $pytanie = $_POST['q']; $zapytanie = "INSERT INTO `bot` (`id`, `data`, `pytanie`, `odpowiedz`) VALUES ('NULL', '$data', '$pytanie', '$odp')"; } $zapytanie = "SELECT * FROM `bot`"; { echo '<tr><td>'. $wiersz[0] .'</td><td>'. $wiersz[1] .'</td><td>'. $wiersz[2] .'</td><td>'. $wiersz[3] .'</td></tr>'; } ?> <br><br> <form method="post"> <input type="text" name="q" /> <br/> <input type="submit" value="ok" /> </form>
Błędy:
Cytat
Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in czat.php on line 66
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in czat.php on line 66
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in czat.php on line 69
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in czat.php on line 66
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in czat.php on line 69