[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?
Modify SQL table with php
Moderators: Moderator, Global Moderator
Modify SQL table with php
Love is all a matter of timing.
It's no good meeting the right person too soon or too late.
If I'd live in another time or place...
...my story might have had a very different ending.
It's no good meeting the right person too soon or too late.
If I'd live in another time or place...
...my story might have had a very different ending.
Modify SQL table with php
What line is it telling you the error is on? We can\'t do much if we don\'t have the line number
/blum.gif\' class=\'bbc_emoticon\' alt=\':P\' />
Anyway, I went to zend just to check it quickly and it had nothing but errors through the whole thing and I added quotes in the mysql_query. That seemed to fix everything.
[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]
Anyway, I went to zend just to check it quickly and it had nothing but errors through the whole thing and I added quotes in the mysql_query. That seemed to fix everything.
[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]
Last edited by Josh on Sun Aug 22, 2004 4:14 am, edited 1 time in total.
[align=center]

“If you stop learning, you stop living.” ~Tami Quiring
“It's the rare man who understands the value of a single perfect rose.”
[/align]

“If you stop learning, you stop living.” ~Tami Quiring
“It's the rare man who understands the value of a single perfect rose.”
[/align]

