anonīms Posted April 26, 2010 Report Share Posted April 26, 2010 http://paste.php.lv/028947c3572a22097cf343a0fe9008cb/nonum Problēma ir tad, ja ligas_komandas tabula ir tukša. Tad while atsakās jebko rādīt. Kā varētu novērst šo defektu? Quote Link to comment Share on other sites More sharing options...
m8t Posted April 26, 2010 Report Share Posted April 26, 2010 echo '<form method="POST"> <table> <tr><td>Spēlētājs:</td><td><select name="speletajs">'; if(mysql_affected_rows($brivie_speletaji)>0) { while($bs = mysql_fetch_assoc($brivie_speletaji)) { echo '<option value="'.$bs['id'].'">'.$bs['lietotajvards'].'</option>'; } } else { echo "ERRROR: TYPE 11 to continue"; } echo '</select></td></tr> <tr><td>Komanda:</td><td><select name="komanda">'; if(mysql_affected_rows($brivas_komandas)>0) { while($bk = mysql_fetch_assoc($brivas_komandas)) { echo '<option value="'.$bk['id'].'">'.$bk['nosaukums'].'</option>'; } } else { echo "ERRROR: TYPE 11 to continue"; } echo '</select></td></tr> </table> </form>'; Quote Link to comment Share on other sites More sharing options...
anonīms Posted April 26, 2010 Author Report Share Posted April 26, 2010 Nu tas tikai parādā, ka nav dati, bet man. ai lab, izdomāšu tā, ka uztaisīšu count(), ja būs 0, tad došu parastu kveriju, ja būs ar > 0, tad došu patreizējo Quote Link to comment Share on other sites More sharing options...
php newbie Posted April 27, 2010 Report Share Posted April 27, 2010 vari mēģināt ar joiniem http://en.wikipedia.org/wiki/Outer_join#Outer_joins 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.