topical media & game development
student-wave-nm1-setPos.php / php
<?php
get values
include("student-wave-nn1-inc-connect.inc");
// get the values from the ajax request...
_POST["name"];
_POST["x"];
_POST["y"];
// ... and update the coordinates (or create a new row if name does not exist)
update
/* Use this for older versions of mysql (though its not worth it, since performance is bad)...
name'"));
if (x', y='name'");
else
mysql_query("INSERT INTO position (x,y,name) VALUES ('y','
query
// use this for mysql-versions >= 4.1.0 instead, for better performance!
mysql_query("INSERT INTO position (x,y,name) VALUES ('x','name') ON DUPLICATE KEY UPDATE x='y'");
exit();
/*
TODO remove inactive/old users from db.
*/
?>
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.