Jump to content

DO..LOOP Query not working


Lokolo

Recommended Posts

Pastebin being a pain.

<?php
session_start();
include("function.php");
db_sign_in();
$name = $_POST['name'];
$password = MD5($_POST['password']);
$civ = $_POST['civ'];
$email = $_POST['email'];
[b]do {
srand((double)microtime()*1000000);
$mapcoord = rand(0,100);
$isitfree = mysql_query("SELECT free FROM map WHERE ($mapcoord = ID)")
} while ($isitfree <>1);[/b]
$check_query = mysql_query("INSERT INTO accounts VALUES ('$name','$password','$email')");
$add_player_query = mysql_query("INSERT INTO players (name, civ, r1, r2, r3, mapID) VALUES ('$name', '$civ', 100, 100, 100, '$mapcoord')");
if ( $civ = "arthurian" ) {
$add_civart_query = mysql_query("INSERT INTO arthurian VALUES ('$name', 100, 100, 100, 5)");
} else {
$add_civazt_query = mysql_query("INSERT INTO aztec VALUES ('$name', 150, 150, 60, 5)");
}
$_SESSION[registered] = "1";
redirect("0","register.php");

?>

Hm, can't see whats wrong. Basically I need to get a random number 1-100, then check whether this item in the list has free of = 1 or not. Bit complicated, ask if you don't understand parts.

Thanks in advance.

Lokolo
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.