Taiga
Taiga

Reputation: 48

Query Update does not work

I'm working with MySQLi and I wanted now I made a form to edit some entries in the database and of course I want to update the data in the database. But for some reason nothing happen. No error either.. I allready used var_dump to see if the php script is getting the data from the form, works fine. Maybe someone can find any mistakes at the update code.

$con->query("UPDATE anime SET 
 epcount = '".$eps."',
 original_title = '".$otitle."',
 japan_title = '".$jtitle."',
 english_title = '".$etitle."',
 genres = '".$genres."',
 studio = '".$studio."',
 season = '".$season."',
 year = '".$year."',
 state = '".$status."',
 type = '".$type."',
 manifestations = '".$manif."',
 trailer = '".$trailer."',
 description = '".$des."' WHERE id = '$animeId");

Upvotes: 0

Views: 60

Answers (1)

Mohamed Abd El Raouf
Mohamed Abd El Raouf

Reputation: 928

The problem in the last line

$con->query("UPDATE anime SET 
 epcount = '".$eps."',
 original_title = '".$otitle."',
 japan_title = '".$jtitle."',
 english_title = '".$etitle."',
 genres = '".$genres."',
 studio = '".$studio."',
 season = '".$season."',
 year = '".$year."',
 state = '".$status."',
 type = '".$type."',
 manifestations = '".$manif."',
 trailer = '".$trailer."',
 description = '".$des."' WHERE id = '".$animeId."'");

Also making the query in this style is a bad practice

Upvotes: 1

Related Questions