$sql="SELECT * FROM notice WHERE nid='$noticeid'";
$d = mysql_fetch_assoc($data);
echo $notice;

When I am retrieving data its saying :
Notice: Undefined index: nid in C:\xampp\htdocs\sm\viewnotice.php on line 53

Wheres i am passing the varibale from previous page and its reflecting in browser too.

<a href='viewnotice.php?nid=$nid'>$ntitle</a>

Please suggest...

Recommended Answers

All 4 Replies

You should write some litle more of your code... like, the code in viewnotice.php for example..

commented: I am not getting please elabrate +1

Can anyone help me am not able to solve this issue ???

<a href='viewnotice.php?nid=$nid'>$ntitle</a>

That is a GET variable not POST


$_POST should be used to retrieve data only when data is submitted through forms. Since you are using a link, data is passed in the URL. so you have to use $_GET to retrieve 'nid'.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.