Hi, When you use insert query then you can use mysql_insert_id and get the last inserted id of the m_id value. But you used mysql_insert_id after select query. Use header("location:index.php?m={$m_id}") function for redirecting the page. Thanks & Regards Udayakumar Sarangapani Sr. PHP Developer CompIndia Infotech Pvt. Ltd. Chennai. "Science is nothing but logic..." ________________________________ From: arvindsri123 <arvindsri123@xxxxxxxxx> To: php-objects@xxxxxxxxxxxxxxx Sent: Saturday, 20 December, 2008 12:56:14 PM Subject: Displaying Primary key Hello All, I am inserting data in a table, its working fine, there is primary key "m_id". after inserting data i m using redirect to go a another page, what i want, when i am redirecting, i want url should be look like this (see below)..but its not working...as I m not able to get "m_id" (A column with primary key) value to pass it with url as i have shown.. echo'<script> location = "upload_photos. php?m_id= '.$_REQUEST[ 'm_id'].' "; </script>'; Thanks, Avi Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/ [Non-text portions of this message have been removed]