Jump to content

Whats the best way to update mysql table in a while or a loop


Mancent

Recommended Posts

This way seems not good.

 

<?php
$username ="MANCENT";
$user_input_x = _xmouse.movement ;//FLASH
$user_input_y = _ymouse.movement ;//FLASH

while(true)
{
$updatepos = mysql_query("UPDATE users_float SET user_input_x = '$user_input_x' , user_input_y = '$user_input_y' WHERE username = '$username'");
}

This way works but whats a better way?

?>

Link to comment
Share on other sites

sure..

 

We are in flash application and as you the user move your mouse on a x y axis you are updating using php server side script to insert as a update where user id x mouse movement and user y mouse movement

 

so if user "A" is in some user zone as user"B" show both or many MMORPG simple script like..

 

Its a Movement script updating mysql table users_float table user_id, user_x, user_y

and then if the users are in the same zone the users see ne and other.

 

its a simple idea. and I have it working but its choppy so I'm looking to see whats the best way to do it using PHP if PHP can do it. I might need to add c++ to the project.

I do not know if this is a bad idea becasue it would always be updating none stop when the users is login..

 

See the idea is when a user clicks on a friends picture that user sends a message to the friend asking if they can come in. then the friend says yes or no and if yes they are both at that users zone where they both can chat private to one and other or have a party in thier personal zone space. and while the user is in that zone with that user they both see each others movement...

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.