<?php
include('connect.php');
$upid=$_POST['id'];
$upname=$_POST['categoryname'];
$updesc=$_POST['description'];
$newupid=mysql_query("update tbl_category set categoryname='$upname', description='$updesc' where id='$upid'")or die(mysql_error());
echo "<script type='text/javascript'> alert('Updated Successfully'); window.location.href='view.php';</script>";
?>
This is updated code. It works successfully. but I want to show alert box "Nothing can be updated" if no changes made. And it should have the same .
AntonyRayan
15
Posting Whiz in Training
Recommended Answers
Jump to Posthttp://php.net/manual/en/function.mysql-affected-rows.php
If it returns zero, nothing was changed.
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.