Janhouse Posted February 3, 2006 Report Share Posted February 3, 2006 Esmu noobs. Kur kļūda? Ķipa visu to kas tiek nolasīts no datubāzes gribu kā $saraksts, lai varu vēlāk iekļaut citur kodā. $queryj = "SELECT Nummurs FROM cilveki WHERE Pieslegums!=''"; $resultj = mysql_query($queryj) or die('Neizdevās.'); while(list($nummurs)= mysql_fetch_row($resultj)) { print"$nummurs, "; } print"$saraksts"; Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 3, 2006 Report Share Posted February 3, 2006 Es dariitu apmeeram shaadi.... $query="SELECT nosaukums1, nosaukums_n FROM ...."; $result= mysql_query($query); $num_results=mysql_num_rows($result); if ($num_results > 0) // parbauda vai vispaar ir rezultaati { for ($i=0; $i<$num_results; $i++) // apstraadaajam ieguutos rez pa rindinjaam { $row=mysql_fetch_array($result); echo '$row['nosaukums1'].'<br>'; // principaa raksti/ dari ko gribi echo '$row['nosaukums_n'].'<br>'; } } else { echo 'Datu naff'; } Link to comment Share on other sites More sharing options...
Janhouse Posted February 3, 2006 Author Report Share Posted February 3, 2006 $queryj = "SELECT Nummurs FROM cilveki WHERE Pieslegums!=''"; $resultj = mysql_query($queryj) or die('Neizdevās.'); while(list($nummurs)= mysql_fetch_row($resultj)) { $query = "SELECT Pieslegums FROM cilveki WHERE nummurs=\"$nummurs\""; $result = mysql_query($query) or die('Neizdevās augsejais laikam.'); list($pieslegums)=mysql_fetch_row($result); if ($pieslegums="lmt"){ $mails="@sms.lmt.lv" } else if ($pieslegums="t2"){ $mails="371$nummurs@sms.tele2.lv"; print"$mails, "; } Sis ir kipa biskin jau padzits uz prieksu, bet man tak vajag to visu, ko vins izdod ara sadzit zem viena $saraksts. Ka to dara? Link to comment Share on other sites More sharing options...
Janhouse Posted February 3, 2006 Author Report Share Posted February 3, 2006 Aaaa oi nepamaniju tevi Grey_wolf. Pameginasu. Thanx Link to comment Share on other sites More sharing options...
Janhouse Posted February 3, 2006 Author Report Share Posted February 3, 2006 A man šito ar vajag piemontēt: if ($row['pieslegums']="lmt"){ $row['nummurs']="@sms.lmt.lv"; print"wtf"; } else if ($row['pieslegums']="t2"){ $row['nummurs']="371$nummurs@sms.tele2.lv"; print"ttf"; } Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 3, 2006 Report Share Posted February 3, 2006 if ($row['pieslegums']="lmt"){ $... 1.kljuuda nevis = bet == = pieskjirs masiva $row['pieslegums'] vertiibu lmt nevis paarbaudiis to un vienmeer buus patiess (true) 2. $row['nummurs']="@sms.lmt.lv"; tu taapat nomainiisi veertiibu nevis papildinaasi (es domaaju ka tev tur glabaajas klienta numurs??? ) (nav apsaluuti nekaadas jeegas to njemt no DB) -- vareetu buut: $mails= $row['nummurs'].'@sms.lmt.lv'; (nezinu ko tev tur iisti vajag....) Link to comment Share on other sites More sharing options...
Recommended Posts