Possible Duplicate:
PHP: “Notice: Undefined variable” and “Notice: Undefined index”
Notice: Undefined variable but it’s defined
when i include the file normal and load the page it works fine but when i load the file in a page using jquery it gives this error, i'm using @include '...';
index.php load it with no error
Notice: Undefined variable: name_2 in C:\wamp\www\webex\files\exhange.php on line 42
when i change content and then load it back with jquery it gives the error
content.load('files\exchange.php').hide().fadeIn('slow'); hideLoading();
the file included contains query to retrieve the info from db, the variable name_2 is the result for that query
$query = mysql_query('SELECT name FROM exchange'); if (!$query)
{ die(); $error = mysql_error(); }
else { $row = mysql_fetch_assoc($query); $name_2 = $row['name']; }