Forsaken Sanctum Map Genarator

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
shadow310
Posts: 8
Joined: Sat Oct 15, 2011 10:11 pm

Forsaken Sanctum Map Genarator

Post by shadow310 »

ok the map.php there is code to make a map i uncommented them but still don't make a make help please
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Forsaken Sanctum Map Genarator

Post by hallsofvallhalla »

are you getting any errors?

I would cut the code out and put it in a page of its own, remember to add include connect.php
shadow310
Posts: 8
Joined: Sat Oct 15, 2011 10:11 pm

Re: Forsaken Sanctum Map Genarator

Post by shadow310 »

no nothing its just doing nothing at all
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Forsaken Sanctum Map Genarator

Post by hallsofvallhalla »

well nothing will echo, show me the code. You checked the DB and nothing is in the map?
shadow310
Posts: 8
Joined: Sat Oct 15, 2011 10:11 pm

Re: Forsaken Sanctum Map Genarator

Post by shadow310 »

no maps in DB

Code: Select all

 // this builds initial MAP table! run only once//////////////
 /* for ($i = 1; $i <= 1000; $i+= 1)
  {
  for ($c = 1; $c <= 1000; $c+= 1)
  {
  $test = "INSERT INTO wasteland (mapr,mapc)Values('$i','$c')";
   $test2=mysql_query($test) or die("Could not get user stats");
  }
  }  */
i commented it out again
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Forsaken Sanctum Map Genarator

Post by hallsofvallhalla »

and did you place this in a new file, name it test.php or whatever then put include 'connect.php' ?
Then at bottom echo "Works";


Show a screen shot of page...
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Forsaken Sanctum Map Genarator

Post by hallsofvallhalla »

here is whole code

Code: Select all

include "connect.php";
$newnum = 0;
for ($i = 1; $i <= 1000; $i+= 1)
  {
  for ($c = 1; $c <= 1000; $c+= 1)
  {
$newnum = $newnum +1;
echo $newnum;  
$test = "INSERT INTO wasteland (mapr,mapc)Values('$i','$c')";
   $test2=mysql_query($test) or die("Could not get user stats");
  }
  }  

echo "Works " . $newnum;

WHOA!!!!!!!!!! Why are you doing 1,000!!! That is 1 million entries!!!
shadow310
Posts: 8
Joined: Sat Oct 15, 2011 10:11 pm

Re: Forsaken Sanctum Map Genarator

Post by shadow310 »

ok when i try it it sends me back all the code
Gustava
Posts: 66
Joined: Tue Dec 29, 2009 5:49 am

Re: Forsaken Sanctum Map Genarator

Post by Gustava »

Are you using the tags?

Code: Select all

<?php

?>
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Forsaken Sanctum Map Genarator

Post by hallsofvallhalla »

hehe i forgot to put those in my code but yes you need to add the php tags
Post Reply

Return to “Beginner Help and Support”