javascript - Edit column inside column inside table_name? -
so need creating game , sql list creates username , password , want store wood,stone,steel data database under correct username don't know how.
its code know is:
mysql_query("update table_name set column = newdata");
but here error won't create because there no such column named column, need search username , insert wood data wood data space.
<?php mysql_connect("localhost","username","password") or die(mysql_error()); mysql_select_db("database") or die(mysql_error()); $wood= "document.getelementbyid('wood').value"; $stone= "document.getelementbyid('stone').value"; $steel= "document.getelementbyid('steel').value"; mysql_query("update `members` set `wood` = $wood `username`=$myusername"); mysql_query("update `members` set `stone` = $stone `username`=$myusername"); mysql_query("update `members` set `steel` = $steel `username`=$myusername"); ?>
use code :
mysql_query("update `table_name` set `wood` = 12 `username`='user'");
Comments
Post a Comment