dearmoawiz Posted April 24, 2008 Share Posted April 24, 2008 hi guys here is the scenario .. in the categories description table category_id is primary key .. so when this query executed it return just one row... now i want to display the name of category without loop so wat will b the next statment which show me the name of category ... waiting for response... $q = "select categories_name from categories_description where categories_id = 1"; $result = mysql_query($q); ? ? ? thnxxx Quote Link to comment Share on other sites More sharing options...
monkeytooth Posted April 24, 2008 Share Posted April 24, 2008 Cant be 100% on this I'm not home I'm at work on light duty playin on the PC feelin a bit burnt out.. but try and make a var out of your results... $blah = $result['categories_name']; then call it out echo $blah; Quote Link to comment Share on other sites More sharing options...
dearmoawiz Posted April 24, 2008 Author Share Posted April 24, 2008 thnx for ur response buddy but it dosent work it just display the blank screen .. now dont say that it may b possible in database no result match wid following criteria .. bcoz there is one field which have the ID = 1 n its name is hardware .. so it must display the result hardware but nothing happened like tht .. waiting for response from any other body .. Quote Link to comment Share on other sites More sharing options...
dearmoawiz Posted April 24, 2008 Author Share Posted April 24, 2008 i need urgent help ?????? Quote Link to comment Share on other sites More sharing options...
dearmoawiz Posted April 24, 2008 Author Share Posted April 24, 2008 here is the solution $row = mysql_fetch_array($result); echo $row['categories_name']; thnxxx for my self Quote Link to comment Share on other sites More sharing options...
delickate Posted April 24, 2008 Share Posted April 24, 2008 what if obtain the result by loop? check out man;) <? $con=mysql_connect("localhost","root",""); mysql_select_db("mp3web",$con); //$q=mysql_query("SELECT * FROM tbl_subscribe WHERE sbc_Email='lovw@love.com'"); $sql6 = "SELECT * from tbl_subscribe where sbc_Email='love@love.com'"; $result2=mysql_query($sql6); while($row = mysql_fetch_assoc($result2)) { extract($row); //global $crsymbol; echo $sbc_Name; } ?> with love 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.