jancuks2 Posted August 16, 2010 Report Share Posted August 16, 2010 Man sanāk izvadīt datus. <?php $result1 = mysql_query("SELECT website FROM extras WHERE id='{$_GET['id']}'"); while($rows = mysql_fetch_array($result1)) { echo 'Mājaslapa: '.$rows['website'].''; } ?> Un man vaig lai izvada vārdu "Nav" ja website rindā nav nekas ierakstīts. Quote Link to comment Share on other sites More sharing options...
vitao.web Posted August 16, 2010 Report Share Posted August 16, 2010 Nu tad pārbaudi vai tev ir ieraksts, ja nav tad parādi savu tekstu:"NAV" Kur problēma? :) Quote Link to comment Share on other sites More sharing options...
jancuks2 Posted August 16, 2010 Author Report Share Posted August 16, 2010 Esmu mēģuinājis bet nesanāk. Vai nevari man parādīt kā ? Quote Link to comment Share on other sites More sharing options...
werd Posted August 16, 2010 Report Share Posted August 16, 2010 <?php $result1 = mysql_query("SELECT website FROM extras WHERE id='{$_GET['id']}'"); while($rows = mysql_fetch_array($result1)) { echo 'Mājaslapa:'.($rows['website'] ? $rows['website']:"Nav"); } ?> Quote Link to comment Share on other sites More sharing options...
jancuks2 Posted August 16, 2010 Author Report Share Posted August 16, 2010 Paldies kad palīdzēji. :) Quote Link to comment Share on other sites More sharing options...
Kemito Posted August 16, 2010 Report Share Posted August 16, 2010 vitao.web - Ieliec parametrā website 1 un izvadīs vieninieku! Es būtu darījis tā: Nočekojis ROW`u daudzumus ( mysql_num_rows($mainigais) ) Tad attiecīgi arī maucis, ja tas ir 0 tad izvadītu nav, ja ir 1 tad izvadītu websaiti. Quote Link to comment Share on other sites More sharing options...
sheps Posted August 16, 2010 Report Share Posted August 16, 2010 (edited) Vari provēt šādi :) <?php $result1 = myslq_query("SELECT $website FROM extras WHERE id='$id'"); ?> kas tas pa samuģījumu :D $website vietaa uzrakstu abrakadabra un lauka nosaukuma manaa tabulaa nava :D neizskataas peec automaatiksas kļūdas? ps: jo $website tak mainiigais lielums.. bet tabulaa lauki tak ir konstanti.. Edited August 16, 2010 by sheps 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.