even 1 tip erbij:
// none of thesehandles are re-used as the connection parameters are different on them all, despite connecting to the same server (assuming 'myuser' and 'otheruser' have the same privileges/accesses in mysql)
$handle_db1 = mysql_connect("localhost","deb27292_world1","Lars@Mafiastar");
$handle_db2 = mysql_connect("localhost","deb27292_world1","Lars@Mafiastar");
// give each handle it's own database to work with, permanently.
mysql_select_db("accounts",$handle_db1);
mysql_select_db("world1",$handle_db2);
doe dit even korter:
// none of thesehandles are re-used as the connection parameters are different on them all, despite connecting to the same server (assuming 'myuser' and 'otheruser' have the same privileges/accesses in mysql)
$handle_db1 = mysql_connect("localhost","deb27292_world1","Lars@Mafiastar");
// give each handle it's own database to work with, permanently.
mysql_select_db("accounts",$handle_db);
mysql_select_db("world1",$handle_db);
Omdat je eigenlijk 1 account heb op je website en daaraan meerdere databases koppelt kan je dit gewoon korter maken..
De volgende code:
$which = $handle_db1;
$dbres2 = mysql_query("SELECT * FROM `users` WHERE `login`='{$_POST['login']}' AND `pass`=MD5('{$_POST['pass']}')",$which);
Naar:
$dbres2 = mysql_query("SELECT * FROM `users` WHERE `login`='".$_POST['login']."' AND `pass`='".MD5($_POST['pass']) ."'");