-1
    $query = "UPDATE `$database`.`$member` SET `email` = \'$rowmem['email']\' WHERE `id` = $rowmem['mem_id']";

I don't know why but this line is showing an error in my page.

It's said there is an syntax error.

Can anyone correct it ??

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • 2
    Learn to use parameters. Don't munge query strings with parameter values. That is dangerous and can lead to hard-to-debug syntax errors. – Gordon Linoff Aug 22 '17 at 11:31
  • Does this answer your question? [How to include a PHP variable inside a MySQL statement](https://stackoverflow.com/questions/7537377/how-to-include-a-php-variable-inside-a-mysql-statement) – Dharman Oct 15 '21 at 09:55

1 Answers1

1
    $query = "UPDATE `$database`.`$member` 
              SET `email` = '".$rowmem['email']."' 
              WHERE `id` = ".$rowmem['mem_id'];

I am sure it will be correct one.

Basically you added slashes \ which are not needed but you need to do concatenation.

Naveed Ramzan
  • 3,565
  • 3
  • 25
  • 30