ccrevcypsys Posted December 14, 2007 Share Posted December 14, 2007 I am creating an admin system for a client and the want to be able to add and remove new sections. I need a flexible form that can work for editing querys for many different tables. Is there any thing like that or any suggestions? Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted December 14, 2007 Share Posted December 14, 2007 For your query statements you are going to need to look into the UNION SQL Command Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted December 14, 2007 Author Share Posted December 14, 2007 ok ill give that a look Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted December 14, 2007 Author Share Posted December 14, 2007 The problem with that is that the tables are all different... Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted December 14, 2007 Share Posted December 14, 2007 yeah...you are going to have to pass the table names in the URL. Or at least thats how i did it. so your URL would like something like this: http://www.yoursitename.com/form.php?table=tablename your code: $var = $_GET['table']; $query = "SELECT * FROM " . $var . " ; Or something to that effect. This could extremely "hairy" LOL! Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted December 14, 2007 Author Share Posted December 14, 2007 well thats how the rest of the site works so i have already done that. i was just wondering about the form to edit the information. I cant think logical enough to start it. How about this is there any way to have php count the columns. like count how many of these there are Table --------------- id customer_id another_column for table that would equal 3 so there would only be 3 input boxes Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted December 14, 2007 Share Posted December 14, 2007 Try the site below. http://www.w3schools.com/sql/func_count.asp Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted December 14, 2007 Author Share Posted December 14, 2007 no dude thats different. Heres the break down The person will log in and view all the different tables. Then she/he will click on a row in the table to edit Then a page will open with a form that will let her edit the information and there will only be one row when they go to edit the information I am trying to work around having to make 8 different forms and wanted to know if there was a way to get around that.. Thats about all. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted December 14, 2007 Share Posted December 14, 2007 Sorry bout my previous post... I reckon i didn't understand ya. Ok... I know how to do what you are talking about. Let me look at some code I have written and get back with you Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted December 14, 2007 Author Share Posted December 14, 2007 ok ill be waiting thanks for the help 2 Quote Link to comment 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.