Elvis L Posted June 26, 2015 Report Share Posted June 26, 2015 Sveiki, vēršos pie Jums ar sekojošu jautājumu Man ir tabulu, kas izskatās apmēram šādi id|vards|stundas|dat|vieta1|kautkas|24|05.05.2015|majas 2|kautkas|14|05.05.2015|majas 3|kautkas|3|05.05.2015|uzielas 4|kautkas|4|05.05.2015|uzielas Vēlos panākt, lai rezūltātus rādītu sekojoši, ja vieta un datums nemainās, summējam stundas un rādam, kā vienu ierakstu, šajā gadījumā Izvada: kautkas 38 majas kautkas 7 uzielas kā to varētu dabūt gatavu? pašlaik diez cik tālu neesmu ticis $veic = mysql_query("SELECT id,vards,stundas,dat,vieta from sus_ieraksti where getid = '".$getid."' and datums = '".$getdats."'"); while($detalas = mysql_fetch_array($veic)){ echo "$vards $stundas $vieta"; } Paldies par palīdzību Quote Link to comment Share on other sites More sharing options...
rpr Posted June 26, 2015 Report Share Posted June 26, 2015 select count(*), vieta, dat from tabulu group by vieta, dat; Quote Link to comment Share on other sites More sharing options...
jurchiks Posted June 26, 2015 Report Share Posted June 26, 2015 PHP PDO. Use it. Quote Link to comment Share on other sites More sharing options...
codez Posted June 26, 2015 Report Share Posted June 26, 2015 jurchiks vēl aizkavējies pagājušajā gadsimtā. Quote Link to comment Share on other sites More sharing options...
Blitz Posted June 26, 2015 Report Share Posted June 26, 2015 Doctrine Quote Link to comment Share on other sites More sharing options...
jurchiks Posted June 27, 2015 Report Share Posted June 27, 2015 Labs ieteikums, nezinu gan, cik newbie-friendly. 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.