joecooper Posted October 12, 2008 Share Posted October 12, 2008 Hi, I am going to make a website, but have hit a hurdle very early on. this is the bit with the problem: grid of 100x100 is displayed to a user. when one of the cells are clicked the cell changes colour. this info will then be added to the mysql db and also the username of who clicked. so i would need a mysql database containing 10,000 entrys. and in turn this data will need to be displayed on a single page. how long would the query take. is it possible? should i do it? is there a better way to do it? Quote Link to comment https://forums.phpfreaks.com/topic/128052-10000-querys-safe/ Share on other sites More sharing options...
corbin Posted October 12, 2008 Share Posted October 12, 2008 The queries would be very short processing time. Transmitting the data, however, would take quite some time. Also, outputting the HTML and or JS for 10,000 divs or whatever is going to be ridiculously large. Quote Link to comment https://forums.phpfreaks.com/topic/128052-10000-querys-safe/#findComment-663154 Share on other sites More sharing options...
PFMaBiSmAd Posted October 12, 2008 Share Posted October 12, 2008 The basic data that represents picked/not-picked would be stored and transfered as packed data using the fewest bits per location. If only one bit is used (picked), this would only take 1250 bytes of information. If you were interested in displaying who picked any location, you would perform a separate query that gets that information on an as needed basis, using the coordinates of the requested location. Quote Link to comment https://forums.phpfreaks.com/topic/128052-10000-querys-safe/#findComment-663168 Share on other sites More sharing options...
corbin Posted October 12, 2008 Share Posted October 12, 2008 Ahhh clever PFMaBiSmAd. (Hrmmm or lack of logic on my part... Can't decide which ;p.) Quote Link to comment https://forums.phpfreaks.com/topic/128052-10000-querys-safe/#findComment-663204 Share on other sites More sharing options...
PFMaBiSmAd Posted October 15, 2008 Share Posted October 15, 2008 In case the OP is still working on this. I prototyped some javascript code to dynamically create the div's for something like this and it takes a significant amount of time to do this for 10,000 div's. A more effective way to try this would be to dynamically create an image on the server that shows the data and simply output this image and use it in the browser either as an image based submit button or as an image map (using one overall region, not 10,000 different regions) and then just use the coordinates where it was clicked on to update the data on the server, regenerate the image and output it again. Quote Link to comment https://forums.phpfreaks.com/topic/128052-10000-querys-safe/#findComment-666107 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.