You are here: Re: Interesting problem « PHP Programming Language « IT news, forums, messages
Re: Interesting problem

Posted by ward on 03/01/06 22:02

On 1 Mar 2006 11:33:23 -0800, "frizzle" <phpfrizzle@gmail.com> wrote:

Thanks again for the helpo Frizzle.

I believe it's this statement that is causing the error...

if (mysql_affected_rows() == 1) { // If it ran OK.

This is from...

if (mysql_affected_rows() == 1) { // If it ran OK.

// Print a message.
echo '<h1 id="mainhead">Edit aTask</h1>
<p>The task has been edited.</p><p><a
href="edit_task.php">Edit another task?</a><br /><br /></p>';
exit();

} else { // If it did not run OK.
echo '<h1 id="mainhead">System Error</h1>
<p class="error">The task could not be edited due to a system
error. We apologize for any inconvenience.</p>'; // Public message.

echo '<p>' . mysql_error() . '<br /><br />Query: ' . $query .
'</p>'; // Debugging message.

include ('./includes/footer.html');
exit();
}


So I guess this means, since there wasn't a change then the statement
above if FALSE and there for I got the error message.

Now I like your idea so what am I comparing against each other?

I assume an array is created when I hit Submit and thus I'm comparing
the contents of that array with the existing data in the database.

If this is the case, am I comparing the created array with the content
in the page or am I needing to connect to the database and compare the
data there?

Am I even in the ballpark?

Thanks.

Ward



>
>I bet there are better ways to achieve this, but you could compare the
>data in
>$_POST against the corresponding data in the DB. if they match, do
>nothing.
>If they don't match, update it ...
>
>Frizzle.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация