![]() |
|
| |||||||
| Notices |
| mySQL & PHP Discussions, information and help with mySQL and PHP. |
![]() |
| | Thread Tools |
|
#1
| ||||
| ||||
|
Hi Folks, We have managed to gather the data from MySQL to veiw as seen at www.gnjgf.co.za/watflip.php I would however like to create the option of perhaps showing the data as I can show from the link at http://uploads.saga.co.za/rankings/rateindx.htm The rows alternate in colour. If there is someone out there who can help I look forward to your replies. |
|
#3
| ||||
| ||||
|
Hi Folks, In my efforts to get this to work - I am now receiveing an error: Fatal error: Call to undefined function row_color() in /home/******/public_html/gnjgf/watflip.php on line 111 I would appreciate it if someone could help in this regard |
|
#4
| ||||
| ||||
|
I can't know what you have done, as you seem to be calling a non defined function. Anyway, there are also very simple ways to do this directly in your table <td> definition. You add a counter ($i) which autoincrements by 1 for each row. Then you add this code (just an example): $bgcolor1 = "#222224"; $bgcolor2 = "#808080"; $bgcolor = $bgcolor1; if($i%2 == "0"){ $bgcolor = $bgcolor2; } And in your <td> definition you add this: echo '....your code <td bgcolor="'.$bgcolor.'"> rest of cel code.... ... rest of code....
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#5
| ||||
| ||||
|
Hi George, Thanks for the info - I will have a look at it and see if I can get it to work better. My big difficulty is identifying exactly where to place this info. Let me try and if I get stuck I will post agian |
|
#6
| ||||
| ||||
|
Hi Rob, Just to throw a spanner in the works but i know you are busy with the script. Are you not openning yourself up to member complaints, by showing their contact details... it's an online golfers database now. LOL We seem to get enough calls from telesales people who always call at the wrong time in SA.
__________________ Andrew Port Elizabeth Web Design Solutions Latest Release Port Elizabeth Optometrists Work In Progress Aircraft Assembly Centre BlueVoda Web Design Portfolio |
|
#7
| ||||
| ||||
|
Hi Andrew, Your sentiments are exactly the same as mine and I agree with you whole heartedly. This page is my test page and once complete you will need to use a login to access. The page name will also be changing to be included to the site better and other applications that will be coming. My php skills being very limited the process is extremly slow - I not complaining - i am learning Hope all is well down there. |
|
#8
| ||||
| ||||
|
Hi George, I have found this text which seems to be similar: <?php $color1="#FFFFCC"; //First Colour $color2="none"; // Second Colour $row_count=0; //Set row_count to 0 while($m=mysql_fetch_array($quey1)) //SQL query { $row_count++;//Counts row_count $row_color = ($row_count % 2) ? $color1 : $color2; //Gets the colour to be used print "<tr style='background:{$row_color}'> //Sets the row colour. } If so where would I insert it. I have tried your method but dont get any where near the required result. Any other views would be most welcome Last edited by Rob (SA); 07-17-2009 at 07:59 PM. Reason: missing info |
|
#9
| ||||
| ||||
|
Rob, it depends on the rest of your code, how can i ever know it ? Usually the first part (the two colors definition) goes before the loop, the counter part (i said $i, you say $row_count, the concept is the same) goes before or immediately after the <table> definition: code................ $bgcolor1 = "#222224"; $bgcolor2 = "#808080"; echo' <table id=.......... etc>'; while(....loop){ $bgcolor = $bgcolor1; if($i%2 == "0"){ $bgcolor = $bgcolor2; } echo '<tr> <td bgcolor = '.$bgcolor.'>cell content......... </tr> more <td>'s...................of the same recordset '; } echo '<table>'; etc
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#10
| ||||
| ||||
|
Hi George, I have it working - thank you |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |