0

after searching in google and SO,i decided to put this here.. i tried changing single quote and backtick to column but it didn't help either.. any help appreciated!!!

$a=mysql_query("UPDATE exercisemember SET reps='$reps' WHERE memid='$memid1'")       or die(mysql_error());

    $b=mysql_query("UPDATE exercisemember SET sets1='$sets1' WHERE memid='$memid1'")       or die(mysql_error());

Thanks in advances.. update 1 the member1 is actually the value of $memid1

user2234992
  • 543
  • 4
  • 8
  • 20

2 Answers2

0

As your title says, there is no colimn member1. What the problem could be is that you you have qoute in the $memid.

Please do an echo on $memid to see what is in the variabele.

Also you could better use pdo or mysqli

it will be something like this with pdo:

//database connection
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);

$sql = 'UPDATE exercisemember SET reps=:reps WHERE memid=:memid';
$update = $dbh->prepare($sql);
$update->bindParam(':reps', $reps, PDO::PARAM_STR); //if it is a integer use PDO::PARAM_INT
$update->bindParam(':memid', $memid, PDO::PARAM_STR);
$update->execute();

This will prevent it from sql injection.

Perry
  • 11,172
  • 2
  • 27
  • 37
0
 $a=mysql_query("UPDATE exercisemember SET reps='".$reps."' WHERE memid='".$memid1."'")  

you can find difference using echo query

M.I.T.
  • 1,040
  • 2
  • 17
  • 34