# Echo this query - sorry for stupid simple question

**URL:** <https://forum.kirupa.com/t/echo-this-query-sorry-for-stupid-simple-question/192106>\
**Category:** programming\
**Created:** [June 26, 2006, 4:57am UTC](https://forum.kirupa.com/t/echo-this-query-sorry-for-stupid-simple-question/192106 "2006-06-26T04:57:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beebs](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@Beebs](https://forum.kirupa.com/u/Beebs)\
**Post date:** [June 26, 2006, 4:57am UTC](https://forum.kirupa.com/t/echo-this-query-sorry-for-stupid-simple-question/192106/1 "2006-06-26T04:57:29Z")

</div>

Here’s my table :

```auto

CREATE TABLE `sections` (
  `sections_id` int(11) NOT NULL auto_increment,
  `sections_name` varchar(100) NOT NULL,
  `sections_parent_id` int(4) NOT NULL default '0',
  PRIMARY KEY (`sections_id`),
  UNIQUE KEY `sections_id` 
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

-- 
-- Dumping data for table `sections`
-- 

INSERT INTO `sections` VALUES (1, 'HOME', 0);
INSERT INTO `sections` VALUES (2, 'NEWS', 0);
INSERT INTO `sections` VALUES (6, 'TESTING', 1);

```

Here’s my query:

```auto

<?php
		  $sections_name = $_GET['sections_parent_id'];
		  $subsectionssql = "SELECT * FROM sections WHERE sections_parent_id > 0";
		  $result = mysql_query($subsectionssql) or die("Invalid query: " . mysql_error()); 
		  		while ($row = mysql_fetch_array($result)) {
					if ($row['sections_id'] == $_SESSION['sections_id'])
?>

```

Within the table, I display the result with this :

```auto

<td bgcolor="#FFFFFF"><?php echo $row['sections_id']; ?></td>
            <td bgcolor="#FFFFFF"><?php echo $row['sections_name']; ?></td>
            <td width="12%" bgcolor="#FFFFFF"><?php echo $row['sections_parent_id']; ?></td>

```

Under column "‘sections\_parent\_id’ the result display “1”.

Question:  
I want, instead of display “1” the result display “Home”.

Here’s my attempt, that did not work :

```auto
<?php ($row['sections_parent_id'] == $sections_name) ?>

```

Can someone please help me?
