keksuss Posted January 29, 2006 Report Share Posted January 29, 2006 Atkal nelaimīgais guestbooks :) ideja tāda- gribu dabūt laukā no db (mysql) ierakstu skaitu (cik ieraksti iekš grāmatas)... šiten te searchu pārraku, nekā saprotama (tb man derīga) neatradu... Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 29, 2006 Report Share Posted January 29, 2006 Slikti meklēji. Rindu skaitu var dabūt izmantojot http://lv.php.net/manual/en/function.msql-num-rows.php Link to comment Share on other sites More sharing options...
v3rb0 Posted January 29, 2006 Report Share Posted January 29, 2006 (edited) select count(*) from graamata + num_rows() nav domāts lai ar to skaitītu cik ierakstu ir tabulā, bet gan lai uzzinātu cik rindas ir resultā no selecta ar kuru tu selectē lauku vērtības. Edited January 29, 2006 by v3rb0 Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 29, 2006 Report Share Posted January 29, 2006 Okei, neliela kļūda :) Link to comment Share on other sites More sharing options...
keksuss Posted January 29, 2006 Author Report Share Posted January 29, 2006 ... nav domāts lai ar to skaitītu cik ierakstu ir tabulā, bet gan lai uzzinātu cik rindas ir resultā no selecta ar kuru tu selectē lauku vērtības... pē, gandrīz smadzenes samežģīju :) bet nu ideja skaidra.... Link to comment Share on other sites More sharing options...
keksuss Posted January 29, 2006 Author Report Share Posted January 29, 2006 Nea, nav gan skaidrs :) man met laukā : "Resource id #6" nevis skaitli... vajadzēja "$count = mysql_query("SELECT count(*) from guestbook");" ?? PS sorry, esmu iesācējs mysql... Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 29, 2006 Report Share Posted January 29, 2006 Jā! Link to comment Share on other sites More sharing options...
keksuss Posted January 29, 2006 Author Report Share Posted January 29, 2006 Jā! A bet rāda to Resource id #6... Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 29, 2006 Report Share Posted January 29, 2006 Kur tev kādu Resource id #6 rāda? Es tak no pirksta nevaru izzīst ko tu tur izvadi. Query ir pareizs. Link to comment Share on other sites More sharing options...
v3rb0 Posted January 29, 2006 Report Share Posted January 29, 2006 pietrukst tev mysql_fetch_*() f-ja Link to comment Share on other sites More sharing options...
Grey_Wolf Posted January 30, 2006 Report Share Posted January 30, 2006 Paulinjsh--> ta vinjam tajaa mainiigajaa $cont tieshaam uz doto mirkli ir resursa ID ;) viss pareizi.... Link to comment Share on other sites More sharing options...
Recommended Posts