Edit mutliple mysql tables with 1 php page

  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

I would like to have a list of table names (along the left hand side) and when the user clicks on them, the table will show (on the right). I'd like the right hand table to be editable in page (a table of inputboxes with a save submit button), and this to be possible without page refreshes.

Anyone know of any existing functions or scripts that do this? It seems stupid to write from scratch if it exists.
I'm not terribly experienced with javascript, so can anyone point me in the right direction?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

Hey man, have you tried looking at Joomla?
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

Whoops, I forgot to mention - I've got about 90% of the site complete, all built from scratch :) Uses php & MySQL.

I'd like a list of the tables in the database & inputboxes along right to modify existing database entries. The tables I want to modify only contain one row of data (a simple list of names).

Apart from a complete rework (into Joomla or similar), are there any simple php scripts/functions?
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Sounds like you're looking for something similar to phpMyAdmin, but with AJAX, yes?
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

Exactly, thanks for putting it so eloquently :)
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

So noone knows of a system? :(
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

Would you like to make it editable for some chosen staff? as well?
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

I can do that - I'd just like to know your thoughts on the best way to achieve the following:

Retrieve & edit multiple mysql database tables with php/javascript (without page refresh - if possible).
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

ha.. that's the tricky one.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

You don't have much to worry about if you know which database to read for the information and how to handle all that.

If you got phpMyAdmin, you can read the information_schema database for specific information about databases and it's tables and apply Javascript to it. I doubt I have the time or ability to do this but if you know Javascript and PHP well enough, you could probably do something with this :lol:
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

Alright, even with a page refresh - without having to make mutliple php pages for each table - any ideas?
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

I don't know of any web software that does that, although I can't imagine it would be too difficult to write yourself?
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

alex89 wrote:
Alright, even with a page refresh - without having to make mutliple php pages for each table - any ideas?


I want to try and see if we can get everything clarified here. You want the same abilities as phpMyAdmin? You can write your own version of it if you want. The basic underlying functionality of it uses a mysql keyword DESCRIBE.

http://dev.mysql.com/doc/refman/5.0/en/describe.html

I don't see any reason you would need more than one php file for multiple tables.
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

I'll explain a little more.

The page required will edit several mysql tables of data (used in other parts of the site), in a graphical table, which displays data, and if you double click/click the edit button, you can edit the data. You can also add new rows, delete rows & sort.

It just seems like a bit of a pain to recode this, I'm sure it does exist, but I haven't come across it. Anyone seen anything like this, or written it in the past?
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

http://www.phpscaffold.com/

Its more than one page but you could easily combine them all.
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

Thanks, I'll have a play later & let you know how I get on
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

I've had a look, it's helped a little, but isn't really what I'm after.

I did find a standard dynamic table that you can edit mysql databases with, it's called smart-grid and avaliable from here.

I don't get how to use it though, the examples confused my feeble mind. Can anyone provide me a simple example of a table of say "Alex", "Ben", "Charles" in a field called "Name"?
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

Okay I see what your after now. Now sure why I didn't think of this at first.

http://webplicity.net/flexigrid/

PHP Example:

http://sanderkorvemaker.nl/test/flexigrid/

I've used it before so let me know if you have any questions.
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

Perfect! Thanks a bunch. Will work on it tomorrow :)
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

I'm having a play with flexigrid, but it isn't showing (at all).

I'm trying to access a single databse table "SalesReps" with just one column "Name". Should be able to sort by name, add/remove/edit existing entries.
Could you show me a really quick example?
  • alex89
  • Bronze Member
  • Bronze Member
  • User avatar
  • Posts: 239
  • Loc: Western Australia

Post 3+ Months Ago

Still stuck :(

Anyone?

Post Information

  • Total Posts in this topic: 21 posts
  • Users browsing this forum: No registered users and 87 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.