Modify SQL table with php
Posted: Sun Aug 22, 2004 3:45 am
[code]$id = $_GET[\'id\'];
mysql_connect("localhost","{{username}}","{{password}}");
mysql_select_db("{{database}}");
$tablename = $_POST[\'category\'];
$title = $_POST[\'title\'];
$definition = $_POST[\'definition\'];
mysql_query(UPDATE $tablename SET title = $title, definition = $definition WHERE auto_id = $id LIMIT 1);[/code]
I have this code, but i get an error on the last line.
[code]Parse error: parse error, unexpected T_VARIABLE[/code]
anyone have any suggestions to fix this?
mysql_connect("localhost","{{username}}","{{password}}");
mysql_select_db("{{database}}");
$tablename = $_POST[\'category\'];
$title = $_POST[\'title\'];
$definition = $_POST[\'definition\'];
mysql_query(UPDATE $tablename SET title = $title, definition = $definition WHERE auto_id = $id LIMIT 1);[/code]
I have this code, but i get an error on the last line.
[code]Parse error: parse error, unexpected T_VARIABLE[/code]
anyone have any suggestions to fix this?