Here are some ideas for an improved debugging methodology.

First, take the query that you think should be working, substitute in
hard-coded values, and test it through the mysql command-line
client interface.

So, for example, run the "update sitesats set..." query and use
hard-coded values for $arate, $areview, $apositive, and so on.
Check whether the rows you expected to be updated were updated.

If that works, then you know it's not the query as such.

Next, take the exact same query and place it in your PHP document.
Still refrain from doing any variable substitutions.  Verify again
that the update worked.

Finally, one by one, add the variables back in.  

Maurice Aubrey

On Mon, Jun 11, 2001 at 05:39:43PM -0700, Vladimir Kravtsov wrote:
> The table sitesats won't update and shows no errors! (even though there
> are two instances of echo(mysql_error()))
> 
> <html>
> <body>
> <?php require('../common.php');
> if (!isset($areview)) { 
> echo("You must review the site"); } else {
> if (!isset($apositive)) {
> echo("You must review the site"); } else { 
> if (!isset($anegative)) { 
> echo("You must review the site"); } else {
> connectdb();
> mysql_select_db(xtopsites);
> $sql = "update sitesats set arate='$arate', areview='$areview',
> apositive='$apositive', anegative='$anegative', validated='2' where
> id='$id'";
> $query = mysql_query($sql);
> echo(mysql_error());
> if (!$query) {
> echo(mysql_error());
> } else {
> echo("Review stored successfully."); }
> 
> } } }
> ?>
> </body>
> </html>
> Any ideas?

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to