# Unexpected T\_VARIABLE... What gives?

**URL:** <https://forum.kirupa.com/t/unexpected-t-variable-what-gives/177324>\
**Category:** Uncategorized\
**Created:** [February 1, 2006, 12:37am UTC](https://forum.kirupa.com/t/unexpected-t-variable-what-gives/177324 "2006-02-01T00:37:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [February 1, 2006, 12:37am UTC](https://forum.kirupa.com/t/unexpected-t-variable-what-gives/177324/1 "2006-02-01T00:37:39Z")

</div>

I’m learning PHP and right now I know probably just enough to be dangerous. :rambo:

I’m getting a T\_VARIABLE error from line 19 of this code and no clue as to what’s throwing it…

any help greatly appreciated!

```auto
<?php 

//this line includes the database connection variables
include_once("config.php"); 

$user=$_POST['user'];
$pass=$_POST['pass'];

if ($user && $pass){
$result = mysql_query("SELECT * FROM users ORDER BY login"); 

$num = mysql_num_rows( $result );
if ($num == 1){
	// And now we need to output an XML document 
// We use the names of columns as <row> properties. 
		echo '<?xml version="1.0" encoding="UTF-8"?>'; 
		echo '<datapacket>'; 
		while($row=mysql_fetch_array($result)){ 0
    	$line = '<user message="" user="'.$row[user].'" pass="'.$row[pass].'" first="'.$row[first].'" email="'.$row[email].'" last="'.$row[last].'"/>'; 
    	echo $line; 
} 
echo '</datapacket>'; 

	} else {
	echo '<?xml version="1.0" encoding="UTF-8"?>'; 
	echo '<invalid message="Sorry, that Login ID and/or Password is not valid"/>' 
}
}

?> 

```

line 19 should be this one:

```auto
	$line = '<user message="" user="'.$row[user].'" pass="'.$row[pass].'" first="'.$row[first].'" email="'.$row[email].'" last="'.$row[last].'"/>'; 

```
