Vecteevs Posted May 28, 2010 Report Share Posted May 28, 2010 Sveiki, tātad atkal jautājums, kā var sūtīt vēstules pa web lapu takā draugiem.lv vai trackeros. Varbūt var kāds iedot kādu pamācību, jo nezinu kā meklēt(pēc kādiem nosaukumiem) Paldies! Link to comment Share on other sites More sharing options...
briedis Posted May 28, 2010 Report Share Posted May 28, 2010 Ir tabula vēstules vēstules (kolonna - sutitajs_id, sanemens_id, temats, saturs). Lai nosutitu vestuli, pievieno ierakstu vestulju tabulai Lai apskatītu vestules, atlasa pec attieciga lietotaja... Man liekas, ka šī jau nu būtu lieta, kuru vajadzētu pašam izdomāt.. nav jau tik sarežģīti... Link to comment Share on other sites More sharing options...
Vecteevs Posted May 28, 2010 Author Report Share Posted May 28, 2010 (edited) Takā visu sataisīju, bet rādās viena kļūda: <?php include ("../dbc.php"); $sql="SELECT sender_id, topic, massage FROM massages WHERE user_email='$_SESSION[user]'" or die(mysql_error()); $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ ?><br /> From: <? echo $rows['sender_id']; ?><br /> Topic: <? echo $rows['topic']; ?><br /> Massage: <? echo $rows['massage']; ?><br /> <p><? } mysql_close(); ?> </p> <?php } ?> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Vai kā savādāk ir jātais? Nu ērtāks variants.. Edited May 28, 2010 by Vecteevs Link to comment Share on other sites More sharing options...
briedis Posted May 28, 2010 Report Share Posted May 28, 2010 $sql="SELECT sender_id, topic, massage FROM massages WHERE user_email='$_SESSION[user]'" or die(mysql_error()); Tas ir interesanti, ka tu pieļauj domu, ka mainīgajam pieškirot string tipa datus varētu rasties mysql errors :)) Link to comment Share on other sites More sharing options...
Леший Posted May 28, 2010 Report Share Posted May 28, 2010 briedis, tas ir kļūdas prediction. PHP, pirms requesta, analizē šo pieprasījumu, un ir spējīgs parādīt error, pat nepieslēdzoties pie MySQL. Kauns nezināt šitādas lietas. Link to comment Share on other sites More sharing options...
Vecteevs Posted May 28, 2010 Author Report Share Posted May 28, 2010 kā tad man būtu jāraksta? Link to comment Share on other sites More sharing options...
m8t Posted May 28, 2010 Report Share Posted May 28, 2010 <?php include ("../dbc.php"); $sql="SELECT sender_id, topic, massage FROM massages WHERE user_email='$_SESSION[user]'"; $result=mysql_query($sql) or die(mysql_error()); while($rows=mysql_fetch_array($result)){ ?><br /> From: <? echo $rows['sender_id']; ?><br /> Topic: <? echo $rows['topic']; ?><br /> Massage: <? echo $rows['massage']; ?><br /> <p><? } mysql_close(); ?> </p> <?php } ?> Link to comment Share on other sites More sharing options...
briedis Posted May 28, 2010 Report Share Posted May 28, 2010 $query = "kveerijs"; $data = mysql_query($query) or die(mysql_error()); Link to comment Share on other sites More sharing options...
Леший Posted May 28, 2010 Report Share Posted May 28, 2010 $sql="SELECT sender_id, topic, massage FROM massages WHERE user_email='$_SESSION[user]'"; $result=mysql_query($sql) or die(mysql_error()); Link to comment Share on other sites More sharing options...
Vecteevs Posted May 28, 2010 Author Report Share Posted May 28, 2010 Paldies! Un vēl viens jautājums, kā izdarīt tā lai piemēram vienā lapā būtu 5 vēstules, un apakšā būtu lapu numuri uz kuriem pāriet? Link to comment Share on other sites More sharing options...
briedis Posted May 28, 2010 Report Share Posted May 28, 2010 Paldies! Un vēl viens jautājums, kā izdarīt tā lai piemēram vienā lapā būtu 5 vēstules, un apakšā būtu lapu numuri uz kuriem pāriet? Meklē forumā - dalīšana lapās Link to comment Share on other sites More sharing options...
gta1151 Posted May 28, 2010 Report Share Posted May 28, 2010 (edited) if(!isset($_GET['lapa'])){ $pages = 1; } else { $pages = $_GET['lapa']; } $max_results = 30; $from = (($pages * $max_results) - $max_results); //Parbaudam, cik produktus ir jaizvada viena lapa $number_in_page = 30; //Aprekinam lapu skaitu $total_query = mysql_query("SELECT COUNT(id) name FROM users"); $user_value = mysql_fetch_array($total_query); $users = $user_value['name']; $total = (($users - 1) / $number_in_page) + 1; $total = intval($total); $start = $curent_page * $number_in_page - $number_in_page; ///Tavs vēstules scripta kods } // Ieprieksheejaa lapa $page .=''; echo $page; echo "</div>"; <? $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM users"),0); $total_pages = ceil($total_results / $max_results); echo "<center><hr><div class='navs'><br />"; for($i = 1; $i <= $total_pages; $i++){ if(($lapa) == $i){ echo "<span><a href='' class='nummuri'><active>$i</active></a> </span>"; } else { echo "<span><a href=\"".$_SERVER['PHP_SELF']."?do=lietotaji&lapa=$i\" class='nummuri1'>$i</a></span> "; } } echo "</div></center>"; ?> Edited May 28, 2010 by gta1151 Link to comment Share on other sites More sharing options...
Vecteevs Posted May 28, 2010 Author Report Share Posted May 28, 2010 skaidrs, atradu. A kas jādara lai sūtītu vēstuli vairākiem lietotājiem? Link to comment Share on other sites More sharing options...
briedis Posted May 28, 2010 Report Share Posted May 28, 2010 skaidrs, atradu. A kas jādara lai sūtītu vēstuli vairākiem lietotājiem? Pievieno chupu ar ierakstiem, kam atshkjiras sanjemeja id :) Link to comment Share on other sites More sharing options...
Vecteevs Posted May 28, 2010 Author Report Share Posted May 28, 2010 Pievieno chupu ar ierakstiem, kam atshkjiras sanjemeja id :) nesapratu kā to izdarīt :( Link to comment Share on other sites More sharing options...
Recommended Posts