SoireeExtreme Posted November 27, 2006 Share Posted November 27, 2006 Ok, I'm creating a game as a select few may know. And I am trying to put something together so that people can walk around by click on north, south and such. This is what I've tried putting together.[code]<?phpif(isset($_POST['submit'])){$ID=$_GET['ID'];$SQL = "update ac_users SET latitude='$latitude+1' WHERE ID='$ID'"; mysql_query($SQL) or die("Could not register: ". mysql_error());echo "<P>Moved North $userstats3[latitude] <P>";}echo"<table BGCOLOR='#D4C0A1'><tr><td><form action='explore.php?ID=$userstats3[ID]' method='post'><TD><input type='submit' name='latitude' value='North'></td></tr><TD><input type='submit' name='submit1' value='East'><td><TD><input type='submit' name='submit2' value='West'></td><tr><td><TD><input type='submit' name='submit3' value='South'></form></td></tr></table>";?>[/code]Now I get no errors whatsoever. And where it says Moved North userstats it should show just that. But it doesn't show anything its blank. And the database isn't updating from userstats to userstats+1 so that it would be 2 or 3 and so on. I'm sure this its probably very crappy coding looking like I don't know what I'm doing. And its just that lol. I don't know what I'm doing. I am still very much new. But as you all can see I'm trying very hard. So if anyone could help me I would be ever so greatful.Now if I change this <TD><input type='submit' name='latitude' value='North'></td></tr> where it says latitude back to submit. I get an error Notice: Undefined variable: latitude in blah blah blah. Thought I'd toss that in. Link to comment https://forums.phpfreaks.com/topic/28613-im-so-clueless/ Share on other sites More sharing options...
trq Posted November 27, 2006 Share Posted November 27, 2006 Where do you define the $latitude variable used in your query? Link to comment https://forums.phpfreaks.com/topic/28613-im-so-clueless/#findComment-130899 Share on other sites More sharing options...
SoireeExtreme Posted November 27, 2006 Author Share Posted November 27, 2006 I'm assuming nowhere even though I did try doing that. And nothing worked. Being now that I have it no errors popping up. What was the point of trying to do that again. I guess I should huh? Link to comment https://forums.phpfreaks.com/topic/28613-im-so-clueless/#findComment-130904 Share on other sites More sharing options...
SoireeExtreme Posted November 27, 2006 Author Share Posted November 27, 2006 Could someone else help me out? At least help tell me how I could go about fixing this. Because as I said I'm clueless. I've been working with all my scripts pretty much this way. And I've been trying many things but I've only been doing everything wrong I guss since I'm here asking for help. And tutorials and other threads aren't doing me much good. So any other help would be greatly appericiated. Link to comment https://forums.phpfreaks.com/topic/28613-im-so-clueless/#findComment-131119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.