Puika1 Posted November 21, 2009 Report Share Posted November 21, 2009 Tātad es uzstādiju šo sciptu http://paste.php.lv/069fb9ce060795c7c9ae5e9eabdb5c26/nonum ,bet ņēmos gar datubāzi kautko sačakarēju un beigās izdzēsu chat db,Un iekopēju no kauna tāda kāda bija sākumā,bet kad rakstu zinju čatā viņu nerāda un datubāzē ar nesaglabā,kas varētu būt par problēmu? datubāze izskatās šādi! CREATE TABLE `chats` ( `ieraksts` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL , `laiks` DATE NULL , `niks` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL ) ENGINE = MYISAM ; Quote Link to comment Share on other sites More sharing options...
xmas12 Posted November 21, 2009 Report Share Posted November 21, 2009 Tak nekopē datubāzē, izveido pats ! Un Izlasi PM! Quote Link to comment Share on other sites More sharing options...
Puika1 Posted November 21, 2009 Author Report Share Posted November 21, 2009 izveidoju db pats ari neiet Quote Link to comment Share on other sites More sharing options...
false Posted November 21, 2009 Report Share Posted November 21, 2009 mysql_query("INSERT INTO chats (ieraksts, laiks, niks) VALUES ('$ieraksts','$laiks','$membera_niks')"); uz mysql_query("INSERT INTO chats (ieraksts, laiks, niks) VALUES ('$ieraksts','$laiks','$membera_niks')") or mysql_error(); Un paradi ko rada? Quote Link to comment Share on other sites More sharing options...
Puika1 Posted November 21, 2009 Author Report Share Posted November 21, 2009 nevienu kludu nerada Quote Link to comment Share on other sites More sharing options...
Morphius Posted November 21, 2009 Report Share Posted November 21, 2009 Varētu būt starpība starp šo kveriju: mysql_query("INSERT INTO chats (ieraksts, laiks, niks) VALUES ('$ieraksts','$laiks','$membera_niks')") or mysql_error(); un šo? mysql_query("INSERT INTO chats (ieraksts, laiks, niks) VALUES ('".$ieraksts."','".$laiks."','".$membera_niks."')") or mysql_error(); Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted November 21, 2009 Report Share Posted November 21, 2009 Nav nekādas starpības. Quote Link to comment Share on other sites More sharing options...
Morphius Posted November 21, 2009 Report Share Posted November 21, 2009 Nav nekādas starpības. Nu tad visdrīzāk kļūda ir nosakot member_id ($_COOKIE['member_id'])... Un kāpēc jālieto while() lai atjaunotu datubāzi ja reiz ir norādīts precīzs member_id? Quote Link to comment Share on other sites More sharing options...
false Posted November 21, 2009 Report Share Posted November 21, 2009 (edited) // Konekcija $selekts = mysql_query("SELECT * FROM ibf_sessions WHERE member_id=".$_COOKIE['member_id']) or mysql_error(); $r = mysql_fetch_array($selekts); if(isset($_POST['ierakstiit'])) { $ieraksts = $_POST['ieraksts']; $laiks = time(); $membera_niks = $r['member_name']; mysql_query("INSERT INTO chats (ieraksts, laiks, niks) VALUES ('$ieraksts','$laiks','$membera_niks')") or mysql_error(); } if($_COOKIE['member_id'] = 0) { echo ' <form action="" method="post"> <input type="text" name="ieraksts" /> <input type="submit" name="ierakstiit" /> </form> '; } $dati = mysql_query("SELECT * FROM chats ORDER BY laiks DESC LIMIT 20 ") or mysql_error(); $er = mysql_fetch_array($dati); echo "<font style=\"color:green;\">".$er['niks']."</font><br>"; echo $er['ieraksts']."<br />"; un kā ar šo? Edited November 21, 2009 by false Quote Link to comment Share on other sites More sharing options...
waplet Posted November 21, 2009 Report Share Posted November 21, 2009 neredzu kur būtu pieliki or die(mysql_error()); :? Quote Link to comment Share on other sites More sharing options...
Puika1 Posted November 21, 2009 Author Report Share Posted November 21, 2009 false tavs variants vispar neder,balta lapa Quote Link to comment Share on other sites More sharing options...
waplet Posted November 21, 2009 Report Share Posted November 21, 2009 vajag or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
Puika1 Posted November 24, 2009 Author Report Share Posted November 24, 2009 es pieliku or die(mysql_error()); bet vienalga nerada nekadu kludu Quote Link to comment Share on other sites More sharing options...
false Posted November 24, 2009 Report Share Posted November 24, 2009 Tad Insert & Select.. Un viss tavs čats ir gatavs Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.