![]() |
|
| |||||||
| Notices |
| mySQL & PHP Discussions, information and help with mySQL and PHP. |
![]() |
| | Thread Tools |
|
#1
| ||||
| ||||
|
Hi Folks, I have a page where I require some help - please. http://www.gnjgf.co.za/stevie/drawtest.php On the left I have a combobox which has three options - 2,3 or 4 In the center is a page that populates from mySql and arranges itself in order of handicap. My request in assitance is this: Can I link the 2,3 or 4 selection to create either 4 columns, 6 columns or eight columns? Secondly once this is done the columns as you see them would not appear as two columns but as 4,6 or 8 and populated according to handicap reading from left to right. I look forward to your replies. |
|
#2
| ||||
| ||||
|
Rob Im not an expert here but i think you are going to have to create the combo box within the script also rather than LINK to the out put as the combo is javascripted itself if you follow what i mean... Karen
__________________ KMAC Enterprise Missouri Free Classified Ads Charming Noveltees~Sports Logos Charms ![]() ![]() I've learned that artificial intelligence is no match for natural stupidity! |
|
#3
| ||||
| ||||
|
Hi Karen, Thanks for the reply. You are more than likely correct. If I could find help on that at first it will be a big step forward for me. The other part I think would be a lot more simple for those who know Php and MySQL. |
|
#4
| ||||
| ||||
|
Rob, Use javascript to autosubmit the form that you are using for the combo box. Then you will need to build a check into your PHP code to evaluate the selected value and then regenerate the table. Your javascript would look something like this: Code: <form name="group" action="drawtest.php" method="post"> <select name="groupnumber" size="1" onChange="javascript:document.group.submit();return false;"> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> </select> </form> PHP Code: |
|
#5
| ||||
| ||||
|
Hi Mattski, Thanks for the prompt response. I am not a computer technically minded person - so lot of this goes over my head. I have been doing more a cut and paste scenarion and trying to learn in that manner. It seems there is a way to get it to work and thats positive - can you perhaps help further? |
|
#6
| ||||
| ||||
|
Rob, If you post your code I can take a look at it. I'm assuming you are using a while loop to generate your table. One thing you can do is add a counter in the loop based on the value of "groupnumber". Then in your while loop you don't close out the table row until you get to the specified number of columns. Then close out the row, start a new one and reset your counter. |
|
#7
| ||||
| ||||
|
Hi, Thank for the reply. Not having great script writing skills and being more of a cut and paste guy this information might be a little jumbled. I currently serves its purpose but I am sure could be improved. PHP Code: |
|
#8
| ||||
| ||||
|
Hi this is the other section of the page that I am trying to link to the previous posting. This coud ideally be on another page that would carry authorisation to make this change (i.e password protected for administrator/s) Thanks for your help in this matter I appreciate it PHP Code: |
|
#9
| ||||
| ||||
|
Rob, If you want this to be set in an admin section I would recommend storing the value in your database in some sort of configuration table and then querying on that value before you generate your table. What you are trying to do is absolutely possible but it's a little complicated and it's helpful to know some more advanced programming skills before tackling a project like this. Cutting and pasting is fine for basic applications but for what you are trying to do, you need to learn to understand the code you are writing. For example the <option> tags that you have in your first post are not being used in this design if all you are doing is outputting a table. You might want to pick up a book or two on PHP and MySQL programming. The MySQL website and PHP website would also be valuable resources for learning some of this stuff. I'd be happy to help you work through some of this if you like. |
|
#10
| ||||
| ||||
|
Hi MAttski, I would be please to acept any help |
|
#11
| ||||
| ||||
|
Rob, Sorry, got busy with work/life etc. Didn't mean to leave you hanging here. Feel free to email me and we can discuss this. I can help you get it worked out but it may be easier to do over email. Thanks, Matt |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |