Jump to content

Tassadar

Members
  • Posts

    32
  • Joined

  • Last visited

Tassadar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Since its just me working on it, and Im learning PHP as I develop the game.. who the hell knows lol. If I had another programmer (preferably someone advanced) it would go a LOT quicker. Its going to be sort of like starcraft, but inter-planetary attacks and defenses. You build up your outpost and you are part of a colony which is 20 different players (outposts). then its basically colony vs colony. Wars, and alliances etc. I also have some pretty badass twists in the storyline that will change gameplay. My host already has unlimited bandwidth and connections so I could have virtually thousands of people on at any given time without any major connection issues.
  2. Sorry for the late reply, didn't see there was one. Yeah its a text-based browser game. Nothing too overly complicated, no crazy CGI. but I have a LOT going for the story line and plenty of ideas.. I just need to figure out how to do them! Cron jobs are killing me right now, and trying to figure out formulas etc..
  3. oh I could pick your brain about lots of little things.. but I'd run this thread into hundreds of pages phpfreaks needs an IRC chat or something..
  4. again, I appreciate the help. I know it has to be frustrating working with someone who isn't as skilled with PHP/SQL btw, in case you were wondering what the heck I am working on, its a space RTS game that is browser-based. that would explain all the strange fields and variables
  5. weird, its working flawlessly now
  6. its reporting: Array //<-----Stats ( [id] => 20 [credits] => 2000 [food] => 2000 [land] => 100 [energy] => 2000 [turns] => 30 [turns_max] => 30 [gas] => 2000 [ore] => 2000 [population] => 500 [buildeff] => 100 [offpts] => 0 [defpts] => 0 [score] => 0 [specialty] => Heavy Artillerist ) Array//<-----Unit ( [id] => 20 [trainee] => 100 [juggernaut] => 0 [infantry] => 50 [marauder] => 0 [terminator] => 0 [reconsq] => 0 [prisoner] => 0 [destroyer] => 0 [colossus] => 0 ) Array//<-----User ( [id] => 20 [colonynum] => 1 [username] => Tassadar [password] => 76d3399809a5646a8ddf9f63ce274c97 [email] => webmaster@aurora-game.net [specialty] => Heavy Artillerist [commname] => Fenix [outpostname] => Mar Sara ) Array//<-----Structure ( [id] => 20 [agridome] => 1 [spaceport] => 0 [barrack] => 5 [researchfac] => 0 [laserbat] => 0 [factory] => 0 [infirmary] => 1 [trainingfac] => 1 ) Array ( [id] => 20 [credits] => 2000 [food] => 2000 [land] => 100 [energy] => 2000 [turns] => 30 [turns_max] => 30 [gas] => 2000 [ore] => 2000 [population] => 500 [buildeff] => 100 [offpts] => 0 [defpts] => 0 [score] => 0 [specialty] => Heavy Artillerist ) Array ( [id] => 20 [trainee] => 100 [juggernaut] => 0 [infantry] => 50 [marauder] => 0 [terminator] => 0 [reconsq] => 0 [prisoner] => 0 [destroyer] => 0 [colossus] => 0 ) Array ( [id] => 20 [colonynum] => 1 [username] => Tassadar [password] => 76d3399809a5646a8ddf9f63ce274c97 [email] => webmaster@aurora-game.net [specialty] => Heavy Artillerist [commname] => Fenix [outpostname] => Mar Sara ) Array ( [id] => 20 [agridome] => 1 [spaceport] => 0 [barrack] => 5 [researchfac] => 0 [laserbat] => 0 [factory] => 0 [infirmary] => 1 [trainingfac] => 1 ) Here's something to really throw you for a loop.. it just.. fixed itself.. I didnt change anything, I even REMOVED those strings to print out the arrays and it works fine.. posting structures, units.. everything.. the only thing I did do was delete the username fields from all but the user table.. think that could have conflicted somehow?
  7. I did this because when I have thousands of users and when I need to look someone up I dont have to find them in the USER table, then match their ID with the ID on another table if I need to edit their data. I mean I shouldnt be doing it often so I could delete the username fields from all the tables except the user table. Ill post a screenshot of my structure so you can see the commname field is there, and that I have a structure table gimmie a bit
  8. and its weird it says undefined variable: structure when the print lists the structure table just fine.. but it didnt list $user at all to get info by username do I just change $stats_get = mysqli_query($myConnection,"SELECT * FROM `stats` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection)); $stats = mysqli_fetch_assoc($stats_get); to $stats_get = mysqli_query($myConnection,"SELECT * FROM `stats` WHERE `username`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection)); $stats = mysqli_fetch_assoc($stats_get); ?
  9. I put the array print out at the top, requesting info from $user, $unit, $stats, Structure and it returned: Array ( [id] => 20 [username] => Tassadar [agridome] => 1 [spaceport] => 0 [barrack] => 5 [researchfac] => 0 [laserbat] => 0 [factory] => 0 [infirmary] => 1 [trainingfac] => 1 ) Array ( [id] => 20 [username] => Tassadar [credits] => 2000 [food] => 2000 [land] => 100 [energy] => 2000 [turns] => 30 [turns_max] => 30 [gas] => 2000 [ore] => 2000 [population] => 500 [buildeff] => 100 [offpts] => 0 [defpts] => 0 [score] => 0 [specialty] => Heavy Artillerist ) Array ( [id] => 20 [username] => Tassadar [trainee] => 100 [juggernaut] => 0 [infantry] => 50 [marauder] => 0 [terminator] => 0 [reconsq] => 0 [prisoner] => 0 [destroyer] => 0 [colossus] => 0 ) Notice: Undefined variable: structure in /home/auroraadmin85/public_html/Template/aurora/main.php on line 15 I suppose I could try and do it based on username? every table has an ID field in which they all match for every user, and have a Username field so Structures has ID, Username, etc... Units has ID, Username, etc.. Stats has ID, Username, etc.. User has ID, Username, etc...
  10. both tables structure and field commname exist for my user and matches the user ID on all tables. I can even provide a screenshot if ya need
  11. it returns Array ( [id] => 20 [username] => Tassadar [agridome] => 1 [spaceport] => 0 [barrack] => 5 [researchfac] => 0 [laserbat] => 0 [factory] => 0 [infirmary] => 1 [trainingfac] => 1 ) Notice: Undefined variable: structure in /home/auroraadmin85/public_html/Template/aurora/main.php on line 128
  12. I edited my post as you were replying
  13. yes that issue has been solved. now on to tackling a couple smaller issues that popped up but I should be able to figure them out. thank you all for the assistance! why will it let me echo $stats['credits'] and echo $unit['prisoner'] but not echo $user['commname'] or echo $structure['infirmary'] They both get their data from: safe.php <?php include("functions.php"); $stats_get = mysqli_query($myConnection,"SELECT * FROM `stats` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection)); $stats = mysqli_fetch_assoc($stats_get); $unit_get = mysqli_query($myConnection,"SELECT * FROM `unit` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection)); $unit = mysqli_fetch_assoc($unit_get); $user_get = mysqli_query($myConnection,"SELECT * FROM `user` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection)); $user = mysqli_fetch_assoc($user_get); $structure_get = mysqli_query($myConnection,"SELECT * FROM `structure` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection)); $structure = mysqli_fetch_assoc($structure_get); ?> I have a table called user, and structure and it wont retrieve data from those two, but it gets data from stats and units?
  14. ah I figured out what was wrong. Must have missed it when I was duplicating the queries. they all say $user and they need to match the query in safe.php.. simple typos for this one..
×
×
  • 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.