Snaip3Rs Posted June 5, 2009 Report Share Posted June 5, 2009 A kas jaliek lai rādītos vārds blakus kas to rakstijis un varētu uzklikšķināt uz viņu un apskatīt viņa profilu ipb members! Quote Link to comment Share on other sites More sharing options...
kechums Posted June 5, 2009 Report Share Posted June 5, 2009 Liec lietotājam pie datu nosūtīšanas sūtīt arī lietotāja unikālo id. Quote Link to comment Share on other sites More sharing options...
Puika1 Posted June 5, 2009 Author Report Share Posted June 5, 2009 Snaip3Rs teu sanāca uzstādī? Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted June 5, 2009 Report Share Posted June 5, 2009 (edited) Ne baigais sviests! Var kads iedot gatavu ipb useriem saistitu catu, nevajag tur nekadu pro bet tikai users on chat un rakstit kur var! :) Lukur sanāca ka paliek tikai divas kļūdas bet tas es nesaprotu! :( <?php $host = "localhost"; // db hosts $dbname = "jzvac"; // foruma datubaze $dbuser = "jzvac"; // foruma db users $dbpass = "1991"; // juusu foruma datubaazes parole $link = mysql_connect($host, $dbuser, $dbpass) or die("NEsanaaca piekontektities: " . mysql_error()); mysql_select_db($dbname) or die("Datubaaze neekstistee"); mysql_select_db("jzvac_db"); $rez=mysql_query("SELECT * FROM tabula ORDER BY lauks"); while($r=mysql_fetch_array($rez)) { echo $r['lauks']; } $selekts=mysql_query("SELECT * FROM ibf_sessions WHERE member_id=".$_COOKIE['member_id']); while($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')"); } } //Shaadu paarbaudi silti neiesaku lietot :) if($_COOKIE['member_id'] > 0) { echo ' <form action="" method="post"> <input type="text" name="ieraksts" /> <input type="submit" name="ierakstiit" /> </form> '; } //Un visbeidzot pats selekts $dati=mysql_query("SELECT * FROM chats ORDER BY laiks DESC"); while($er=mysql_fetch_array($dati)) { echo $er['niks']."<br />".$er['ieraksts']."<br />"; } ?> Kļūdas... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/jzvac/public_html/sms.php on line 11 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/jzvac/public_html/sms.php on line 35 Edited June 5, 2009 by Snaip3Rs Quote Link to comment Share on other sites More sharing options...
Puika1 Posted June 6, 2009 Author Report Share Posted June 6, 2009 help vel mazliet tagad ejot manalapa.lv/cats.php ieejot rada bet kautko uzraksta man nerāda rakstīto ziņu tikai visulaiku to logu Quote Link to comment Share on other sites More sharing options...
Kefiirs Posted June 6, 2009 Report Share Posted June 6, 2009 Ieteikšu vienu lietu tev, tad tu savu čatu varēsi uztaisīt! 1) Learn SQL 2) Learn PHP Quote Link to comment Share on other sites More sharing options...
Puika1 Posted June 6, 2009 Author Report Share Posted June 6, 2009 man teica ka sql tipa ir pareizs 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...
Snaip3Rs Posted June 7, 2009 Report Share Posted June 7, 2009 (edited) man sanaca bet vai kads var pateikt kā pie šī pielikt lai tikai ipb lietotāji varētu rakstīt kechum lūdzu izpalīdzi! $file = "shouts.txt"; // Name of the file which // contains the shouts $shouts = 4; // Number of shouts to be displayed $maxlength_name = "20"; // Maximum length of name $maxlength_text = "150"; // Maximum length of text $break_name = "15"; // Break name after characters // without space $break_text = "15"; // Break text after characters // without space ?> <p> <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> <input type="text" value="" name="input_name" maxlength="<?php echo $maxlength_name; ?>" onfocus="if(this.value==''){this.value='';}" onblur="if(this.value==''){this.value='Your name';}" /><br /> <input type="text" value="" name="input_text" maxlength="<?php echo $maxlength_text; ?>" onfocus="if(this.value==''){this.value='';}" onblur="if(this.value==''){this.value='Your text';}" /><br /> <input type="submit" value="Sūtīt" /> </form> </p> Edited June 18, 2009 by Snaip3Rs 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.