Hi, In index.php I have code that allow me to change the text from "activate" to "Deactivate" or "Deactivate" to "activate' by clicking the link using ajax and then refresh in same page... and it will update in mysql database...please see the code ...

HTML Code:
	$.ajax({
	type: "GET",
	url: "action.php",
	data: { status: "<?php echo $_GET['pid'];?>" }
	})

And in action.php page is ....


PHP Code:
<?php
include('db.php');
if(isset(
$_GET['status']))
{
$status1=$_GET['status'];
$select=mysql_query("select * from product where product_id='$status1'");
while(
$row=mysql_fetch_object($select))
{
$status_var=$row->status;
if(
$status_var=='0')
{
$status_state=1;
}
else
{
$status_state=0;
}
$update=mysql_query("update product set status='$status_state' where product_id='$status1' ");
if(
$update)
{
header("Location: index.php");
}
else
{
echo 
mysql_error();
}
}
?>
<?php

?>

I was wondering if this possible to be done WITHOUT refresh the page after click the link to change text in index.php page!

I'm not really good at the ajax!