Jump to content

Micard

Members
  • Posts

    18
  • Joined

  • Last visited

Micard's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yep, works. Thank you sir!
  2. Oh I see, let me check it out.
  3. Yeah, that's what I'm trying to do! How do I do that? With the SELECT query I checked the number of rows returned, what about this case?
  4. Sorry guys, I don't want to create a separate topic for this, but mysqli_fetch_array fails in my code and returns false. I have no idea why. I tried to check it so many time already... The SQL seems to be fine this time. <?php session_start(); include_once './connect.php'; if($_POST['cc_request'] != null && $_POST['cc_request'] == "create_cc") { if(isset($_POST['player_gender']) && isset($_POST['player_path'])) { $PlayerGender = $_POST['player_gender']; $PlayerGender = mysqli_real_escape_string($link, $PlayerGender); $PlayerPath = $_POST['player_path']; $PlayerPath = mysqli_real_escape_string($link, $PlayerPath); $PlayerName = $_SESSION['username']; $PlayerPassword = $_SESSION['password']; $cc_query_sql = "UPDATE players SET gender = '$PlayerGender', path = '$PlayerPath' WHERE username = '$PlayerName' AND password = '$PlayerPassword'"; $this_query = mysqli_query($link, $cc_query_sql); $this_query2 = mysqli_fetch_array($this_query); if(!$this_query2) { $cc_result = "couldnt_create"; echo "cc_request=$cc_result"; die(); } else { $cc_result = "char_created"; echo "cc_request=$cc_result"; } } else { $cc_result = "pGpP_notset"; echo "cc_request=$cc_result"; die(); } } else { $cc_result = "not_exist"; echo "cc_request=$cc_result"; die(); } ?>
  5. Oh.. about that.. yeah! I don't know why I did that. I was cleaning out something since I had a temporary replacement and I am just a dum-dum Thank you ugh...
  6. Uhm.. Yeah? Am I supposed to see something here? Sorry if I'm being dumb. It's been a while writing a whole bunch of scripts in 2 languages so I might have lost the "sight" if you know what I mean
  7. Hey there! Here's what I got... Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username = 'Micard', password = '21232f297a57a5a743894a0e4a801fc3'' at line 1 File.php: <?php session_start(); include_once './connect.php'; if($_POST['cc_request'] != null && $_POST['cc_request'] == "create_cc") { if(isset($_POST['player_gender']) && isset($_POST['player_path'])) { $PlayerGender = $_POST['player_gender']; $PlayerPath = $_POST['player_path']; $PlayerName = $_SESSION['username']; $PlayerPassword = $_SESSION['password']; $cc_query_sql = "INSERT INTO `players` (`gender`, `path`) VALUES ('".mysqli_real_escape_string($link, $PlayerGender)."', '".mysqli_real_escape_string($link, $PlayerPath)."') WHERE `username` = '".$PlayerName."', `password` = '".$PlayerPassword."'"; $this_query = mysqli_query($link, $cc_query_sql) or die(mysqli_error($link)); $this_query2 = mysqli_fetch_array($this_query); if(!$this_query2) { $cc_result = "couldnt_create"; echo "cc_request=$cc_result"; die(); } else { $cc_result = "char_created"; echo "cc_request=$cc_result"; } } else { $cc_result = "pGpP_notset"; echo "cc_request=$cc_result"; die(); } } else { $cc_result = "not_exist"; echo "cc_request=$cc_result"; die(); } ?>
  8. Best answers as always. Thanks you again! I'll think about it and might just start actually learning javascript. php I can put aside for a while, learn a bit of js, and then ajax. I guess that makes sense. Thanks dude!
  9. I was just thinking about an old project I had once. Basically it's a bundle of php+flash [AS3]. It's a pain in the butt but I think that will be the best option to be honest. it is extremely inconvenient but it works, so i might just do that since again I have a bit of experience in that. Ugh.. Why don't they make some easier and more handy stuff for this kind of purposes... well, thank you for your replies, scootsah! Much appreciate it!
  10. scootsah, no sir, just a fancy name for the actual gamepage.
  11. scootsah, thanks again! Well, I know that much. I'm interested in the efficiency which is a composite of knowledge, time, and so on. My question is what would be a better option here? So just go on with a php+js bundle or rather build it all using mainly js. But here's a thing, I don't know js that well at all. Does it make a huge difference on building stuff using php+js bundle and just js? I can't just say, hey I'm going to go and learn js in a week and make a mmorpg, killer of all mmorpgs in the world. Is there really a point to make it all in js but spending a huge chunk of time learning js thoroughly rather than make it using what I already know and spent little time learn some stuff. So again, is there really a huge difference?
  12. Hello there! Long story short, I'm just practicing and playing around making this online multiplayer game, mmorpg basically. Hold on there throwing rotten tomatoes at me No-no, it's going well, I'm pretty satisfied with the results. I have a pretty solid knowledge of C++ so it's going pretty easy with PHP, not to mention that I have some experience. Now when that is settled. I have a php-driven client with a mysql database. Okay. Stuff's working, all's great. The thing is, I want to kind of walk away from reloading pages and doing lame checkboxes for specifying hit location and all that. I want to implement some real graphics, animations, etc. The thing is I have a very little experience in JavaScript. I still have some but it's not enough to answer my questions. Here's what I want. In the middle is a "dynamic game window". I do not want to refresh the page every time I click on the character or map button, or for example I want the area to be scrollable (for the map for instance). Same for chat. And I am not sure how to do that using both php and js. I know you could do it all using just js but I don't know it as well as I know php, at least I want to believe I know it well enough for this task. If you great all-knowing masters could give me a piece of advice, I'd really appreciate that. I have some ideas, if you could just direct me. IDEAS: 1) Gamewindow - js. All other stuff - php. PHP page with a js script on it. Wouldn't it be slower than other options? How to implement this interaction between js and php scripts? There's exmaple on the drawing. So if I click on that button a js script would be called. (is it as easy as href='script.js' and I am just a dum-dum?) 2) Both gamewindow and navigation - js. I don't have a clear idea on how to do that, but it certainly has its advantages. 3) Just make the whole thing using js. The problem is I don't know js. Would it actually be better, faster, at some point easier just to learn js? Clearly, it's in many ways better than php but I don't have to learn php from the very beginning, that's the thing. 4) Other suggestions? + this is just a hobby, I dont think I have time to learn something as massive as JS. But maybe I'm wrong and it's not that bad? Maybe you could also recommend either a good piece of literature on the topic you recommend or an article. I really-really don't want to start with a "JS for dummies". I can write scripts, it's just that I can't do anything more complicated than that.
  13. Alrighty then! That's a very good code example! Thanks a lot!
  14. Could I have a query example please?
  15. Thanks for the replies! Chocu3r, basically on the completion of the event I just set text of the chatbox like this: "chatbox.Text + AJAX.LastData" <- pseudo-code scootah, I am not sure how I am pulling only the one I posted out. See, the chatbox is being updated automatically every 0.1 seconds. If any new messages were added, shouldn't they be shown? And you're right, this is super ineffective as a lot of other things in Construct 2. Unfortunately this is how it works. I will try to switch to sockets but AJAX is just so much easier even though it's slower.
×
×
  • 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.