|
-
Jun 25th, 2002, 03:16 PM
#1
Thread Starter
Hyperactive Member
Updated or not Updated $Result=1 Why
in this code:
$Sql = "UPDATE Existent SET UserName='$UserName',Existent='$Existent' WHERE Existent<1000";
$Result = mysql_query($Sql);
echo $Result;
----------
I want to test if row is updated or not but when I echo $Result
if row is updated $Result=1 and If row is not updated $Result=1 also .. Why ?
How can I test if Row is updated or not ?
-
Jun 25th, 2002, 04:05 PM
#2
the only effiecient way to do it is to get the total rows that it updated
and it is not good practice to name column names as the same as your table names
-
Jun 26th, 2002, 03:34 AM
#3
Thread Starter
Hyperactive Member
ammmmmm
I want to use Update and all that I want to know how can I know if any row(s) is changed or not.
if any row(s) is changed give me True Else False .. How can I do that ?
----------
-
Jun 26th, 2002, 05:48 AM
#4
Addicted Member
I think I answered this one in the other thread. Try using mysql_affected_rows(), that should solve your problem.
http://www.php.net/manual/en/functio...ected-rows.php
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|