PHP/MySQL Question: Can I manage the DB in real-time?

holdeN

Limp Gawd
Joined
Mar 15, 2002
Messages
258
Hello. I have a MySQL database with 2,000+ rows. Each row containing about 60 fields. All the fields are VARCHARs (i dont know if this is the best way to go or not?)... no TEXTs.

Anyways, Im trying to create a way to manage these listings in a user friendly fashion for other people in PHP. I know how to create a form and pupulate the form with all the database info and then submit the changes with a button. But I was wondering if there was a way to scroll through these without having to refresh the page/submit a form? Like just have a left and right arrow button that will display the data for each row in the fields and populate it on the fly.

Is this possible? I read something about xml-rpc. Would I use this? Or is there an easier way? Any help is greatly appreciated!
 
i don't believe this can be done with just html. html, once received by the user is static, after you download the page, it doesn't change until the next refresh. understand that the data can easily enough be modified on the php side but once it's transmitted, it's done with. perhaps flash could be used but i'm not really familiar with it. perhaps a java applet or just a dedicated gui program
 
I think java would be more likely than Flash. My understanding with Flash is that you have to open a whole new connection with the webserver backend (PHP or whatever) for every transaction, which isn't necessarily much gain over something like phpMyAdmin. Java, OTOH, ought to be able to maintain an active DB connection.
 
If your network is fast, just do a this.form.submit every time you tab out of a field.

Bam, updated.
 
javascript should be able to do this. I think javascript can call a php function to get the next line, then you can document.write the result of the php function.
 
Fryguy8 said:
javascript should be able to do this. I think javascript can call a php function to get the next line, then you can document.write the result of the php function.
How can JS call a php function? PHP is server processed before the page is loaded. I completely fail to see how you would get JS to call a PHP function because by the time the JS is available the page is loaded and there are no PHP functions to be called.
 
Maybe it's possible that JS could load a URL as text data and exec a PHP function in that fashion. PHP could make such an external call, as could Flash.

I've never heard of it done with JS, though, so I'm not optimistic.
 
what you could do is get all your information from all the fields in one submit, have them put into hidden divs, then with javascript hide and show layers as needed. this would really work quite well for what your doing and i think its the closest to what you want to acheive. the only bad thing about this is if you are working with a large amount of data there will be alot of stress on the server to load all the fields.
 
jizzypop said:
the only bad thing about this is if you are working with a large amount of data there will be alot of stress on the server to load all the fields.
And given the 2000+ DB rows, etc, etc, I think this falls easily into "Bad Idea."

Nothing against the suggestion in principle -- it would certainly work -- but sending a whole database to the client, and then having to send it all back to the server, is really tough to justify.
 
lomn75 said:
And given the 2000+ DB rows, etc, etc, I think this falls easily into "Bad Idea."

Nothing against the suggestion in principle -- it would certainly work -- but sending a whole database to the client, and then having to send it all back to the server, is really tough to justify.

Actually the OP is right about XMLRPC. It would be entirely possible using JS and XMLRPC to make RPC calls (in realtime) to a PHP script that performed the actions and returned the results. (This is roughly what GMail does) I would argue whether it's any MORE efficient than doing it in PHP but that wasn't the question. Here's a project that has this exact concept in mind. http://xmlrpccom.sourceforge.net/scriptserver/
 
Back
Top