Jump to content

help regarding MySQL query ...


dearmoawiz

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/102664-help-regarding-mysql-query/
Share on other sites

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 ..

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='[email protected]'");

$sql6 = "SELECT * from  tbl_subscribe  where sbc_Email='[email protected]'";

$result2=mysql_query($sql6);

while($row = mysql_fetch_assoc($result2))

{

extract($row);

//global $crsymbol;

echo $sbc_Name;

}

 

?>

with love

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.