Jump to content
Larry Ullman's Book Forums

Recommended Posts

Here's the code

		$title="MYTITLE";
		$image_id=5;
                // Make the update database query:
              $q = "UPDATE ".DBTABLE."   
                SET image_title='$title',
                available='$available',
                height='$height',
                width = '$width',
                framed ='$framed',
                matted='$matted',
                media= '$media',
                price= '$price',
                comment = '$comment',
                hold = '$hold',
                sold = '$sold',
                print_available = '$printAvailable',
                date_created = '$date_created',
                additional = '$additional'
                WHERE image_id=$image_id LIMIT 1";

                $r = @mysqli_query ($dbc, $q); 

				
				if (mysqli_affected_rows($dbc) == 1){
            echo "The number of rows affectd is 1";
				} else {echo "There were no rows affected";
				
				}

The result is always that there are no rows affected

I am positive about the following:

1. the db table column names are all correct

2. there is an image_id in the table whose value is 5

3. the table name DBTABLE is correct

 

Therefore the image_title should be updated. But it doesn't

Furthermore, I get not error messages. Just that no rows were affected.

 

caveat:

I've been away from mysql for a while so this could be a really dumb thing.

 

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...