Jump to content

Birdmansplace

Members
  • Posts

    170
  • Joined

  • Last visited

Contact Methods

  • MSN
    pioneerbirdy@hotamil.com

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Birdmansplace's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks for your input. The first "page" of code was from someone else and its easier for me to follow making another db connection to get other data and display it differently. My ability to code is very basic and the ability to code both sets together is something i just cant wrap my head around. My code is a mess and spread out over many files but i break code up so i can follow it better. Late last night i read and re-read the code and i finally figured out why it wasn't displaying anything. The last <?php?> tag at the very end i change to <?php and should have just left it at <?. I deleted the php tag and it worked. This code is apart of a project i took on for my inlaws horse arena to make webpage based event log for competitions. Thankfully i am almost done changing the code that i wrote to mysqli. For anyone who wants to know/see more about this can check this out and once i am done i will update new files to https://sourceforge.net/projects/php-event-tracklog/
  2. Some one from here helped me create this and i have added to it. Since i have updated my server everything works now except this code. Any help would be great. <?php include("../../db_inc.php"); // define HOST, USERNAME etc $db = new mysqli(HOST,USERNAME,PASSWORD,'roundrobin'); $sql = "SELECT result_id , round_no , roper_id , roper , heeler_id , heeler , time FROM result t INNER JOIN RRroper r ON t.roper_id = r.sid INNER JOIN RRheeler h ON t.heeler_id = h.sid ORDER BY round_no, roper_id"; $output=''; $res = $db->query($sql); $currRound = 0; while (list($resid, $round, $rid, $roper, $hid, $heeler, $time) = $res->fetch_row()) { if ($round != $currRound) { if ($currRound) { // end previous form $output .= "</table></fieldset> <input type='submit' name='btnSub' value='Submit Round'></form></div>\n"; } // start new form for round $output .= "<div class='form'><form method='post' action='roundrobin_updt.php'> <fieldset><legend id='$round'>Round $round</legend> <table border='1'> <tr><th>#</th><th>Header</th><th>Heeler</th><th>Time</th></tr>\n"; $currRound = $round; } $output .= "<tr><td class='ctr'>$rid</td><td>$roper</td><td>$heeler</td> <td class='ctr'><input type='text' name='time[$resid]' value='$time' size='8'></td></tr>\n"; } $output .= "</table></fieldset> <input type='submit' name='btnSub' value='Submit Round'></form></div>\n"; ?> <html> <head> <script type="text/javascript"> jQuery(document).ready(function($) { // Hook up the current state to the nav bar $('.page-navigation').onePageNav(); }); </script> <?php ini_set("display_errors", "10"); error_reporting(E_ALL); include("../../dbinfo.php"); $con = mysqli_connect($host,$username,$password); mysqli_select_db($con, $database7) or die( "Unable to select database"); // Retrieve data from database $sql="SELECT * FROM $tbl_name13 ORDER BY sid DESC LIMIT 1 "; $result=mysqli_query($con, $sql); while($rows=mysqli_fetch_array($result)){ ?> <title>RR <?php echo $rows['d1header']; ?></title> <link rel='stylesheet' type='text/css' href='../../tracklog.css'> <style type="text/css"> body { font-family: sans-serif; font-size: 12pt; background-color:#666; } table { margin-left: auto; margin-right: auto; width: 90%; /* border-collapse: collapse; */ } th { color: black; background-color: #369; padding: 5px 3px; } td { background-color: white; font-family: sans-serif; font-size: 12pt; padding: 0 3px; color: black; t } td.ctr { background-color: #ccc; text-align: center; width: 100px; } div.form { background-color: #CCC; margin-bottom: 10px; margin-left: auto; margin-right: auto; padding: 5px; width: 900px; text-align: center; } legend { padding: 3px; background-color: #369; color: white; } fieldset { text-align: left; } input[type='text'] { text-align: right; } h1 { text-align: center; } </style> </head> <body> <div id="top"></div> <h1><?php echo $rows['d1header']; ?></h1> <?php } ?> <?php // close connection mysqli_close($con); ?> <scroll class="site-navigation page-navigation1"> Quick Scroll <ul class="menu"> <li><a href="#top">R1</a></li> <li><a href="#2">R2</a></li> <li><a href="#3">R3</a></li> <li><a href="#4">R4</a></li> <li><a href="#5">R5</a></li> <li><a href="#6">R6</a></li> <li><a href="#7">R7</a></li> <li><a href="#8">R8</a></li> <li><a href="#9">R9</a></li> <li><a href="#10">R10</a></li> </ul> </scroll> <h1>Round Robin Event</h1> <div> <?php =$output ?> </div> </body> </html>
  3. most of my site is now switched to mysqli but i am having issues with a page. its not giving me any errors and its fetching the info from the db. i have an edit function per entree that loads this page. when i click on it the edit and the page loads there is no info from db to edit and when i submit nothing changes. some one mind taking a look, thanks. <? ini_set("display_errors", "10"); error_reporting(E_ALL); include("../dbinfo.php"); $con = mysqli_connect($host,$username,$password); mysqli_select_db($con, "database") or die( "Unable to select database"); // get value of id that sent from address bar $sid=$_GET['sid']; // Retrieve data from database $sql="SELECT * FROM simple_search WHERE sid='$sid'"; $result=mysqli_query($con, $sql); $rows=mysqli_fetch_array($result); ?> <body bgcolor="#666666"> <br /> <table width="95%" border="0" cellspacing="1" cellpadding="0" align="center"> <tr> <form name="form1" method="post" action="crew_update_ac.php"> <td> <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center"> <tr> <td height="64">&nbsp;</td> <td colspan="3" align="center"><strong>Update Upcoming Event</strong> </td> </tr> <tr> <td align="center" width="9%"><strong>Event Name</strong></td> <td width="85%"><input name="stitle" type="text" id="stitle" value="<?php echo $rows['stitle']; ?>" size="50"></td> </tr> <tr> <td width="9%" height="54" align="center"><strong>Event Date</strong></td> <td width="85%"><input name="datepicker" type="text" id="datepicker" value="<?php echo $rows['datepicker']; ?>" size="50"></td> </tr> <tr> <td align="center" width="9%"><strong>Event Info</strong></td> <td width="85%"><textarea name="sbody" id="sbody" cols="150" rows="50"><?php echo $rows['sbody']; ?></textarea></td> </tr> <tr> <td align="center" width="9%"><strong>Picture</strong></td> <td width="85%"><input name="pic" id="pic" size="50" value="<?php echo $rows['pic']; ?>"></td> <td>Current Picture <br><img src="<?php echo $rows['pic']; ?>" width="173" height="137"/></td> </tr> <tr> <td align="center" width="9%"><strong>Flyer</strong></td> <td width="85%"><input name="file" id="file" size="50" value="<?php echo $rows['file']; ?>"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td align="center"><input name="id" type="hidden" id="id" value="<?php echo $rows['sid']; ?>"> <input type="submit" name="Submit" value="Submit" /></td> <td width="5%" align="center">&nbsp;</td> <td width="1%">&nbsp;</td> </tr> </table> </td> </form> </tr> </table> </body> <?php // close connection mysqli_close($con); ?>
  4. see what you mean by the echo tag.. its fetching data now.
  5. because none of the information is loading on the page that is stored in the db
  6. I wrote a website years ago and when i finally upgraded the system its was running on all my mysql commands are depreciated. So i started working on the small files to fix all the errors and now that i no longer have errors the code seams to not fetch the data from the db. its been years since i coded and now i have to re educate my self. Any help would be nice, thanks <?php ini_set("display_errors", "1"); error_reporting(E_ALL); include("dbinfo.php"); $con = mysqli_connect($host,$username,$password); // Connect to server and select database. mysqli_select_db($con, "databasename")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name3 ORDER BY date DESC LIMIT 3"; $result=mysqli_query($con, $sql); ?> <br /> <?php while($rows=mysqli_fetch_array($result)){ ?> <table width="85%"> <tr> <td width="50%" align="left"><p><a href="events/viewevent3.php?sid=<? echo $rows['sid']; ?>" class="link">&nbsp;<? echo $rows['stitle']; ?></a></p> <p class="clr-1"><? echo $rows['datepicker']; ?></p> <p class="p3">Click event name for more Details!</p></td> <td width="50%" align="right"><img src="<? echo $rows['pic']; ?>" width="171" height="137" />&nbsp;&nbsp;</td> </tr> </table> <?php } ?> <?php mysqli_close($con); ?>
  7. there will have to be even amount of ropers and healers to make it fair for everyone.
  8. couldn't save my edited post for some reason. so heres what i was adding: so not sure what to do with changing "10" to read the count of how many ropers are in the database. Once thats figured out i am also going to make a table to save the output to the db so i can save the times for each pair every round. I would like it to display the same way as well if possible. To sum it up: first step would be to enter names to database. step 2 the code you made to display and make sure everything is correct step 3 save displayed output to a table along with a column for time step 4 display saved output with the ability to save round time per pair per round step 5 when all rounds complete view it as your code does with saved times Thanks
  9. Barand I have been messing round with the code you posted and have been trying to do some stuff. I have setup a database called roundrobin in mysql. there is 2 tables RRroper, RRheeler. in each table there is 4 columns sid(auto increm), roper/healer. I am trying to figure out the code needed for $ropers and $heelers= to login and pull names from the database. include("dbinfo.php"); mysql_connect($host,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); // Retrieve data from database $sql="SELECT * FROM roper ORDER BY sid"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ echo $rows['roper']; } this will read the database but can't get it to word in your coding. I have changed $result to $ropers with no luck. removed while($rows.... and the next 2 lines with the same issue. The other issue will be once i pull info from the db if i have more than 10 pairs not all will display for ($round=1; $round<=10; $round++) { so not sure what to do with changing "10" to read the count of how many ropers are in the database. Thanks
  10. Yes to your first question requinix, and I like your idea because you say its more simple as long as your able to use mysql database. I need to register them in a table and the shuffle them from the table and save it to another table. From that other table i would need to be able to add a time to each pairing and save it back to the table so at the end we can find the winner.
  11. martin nicky and olivia heal for alice then bob and finally cindy. So there would be three rounds and never with the same partner. and for each round i need to be able to log a time per pair per round. Round1 Alice & Martin _time_ Bob & Nicky _time_ Cindy & Olivia _time_ Round2 Alice & Nicky _time_ Bob & Nicky _time_ Cindy & Martin _time_ Step one Enter roper and healer by name to a database Step two Use info from step one to make round robin list and save it. Step three Pull list from step two and be able to save a track time per pair and save again to database. Hope that helps
  12. Thanks for the in-put... The way i worded the opening topic was to be able to relate to alot of users to see what i should do. I am building a web based "arena log" for my father inlaws horse arena and they host a few different things. The round robin they do is team round robin and its a roper and a healer (car, driver as stated in opening topic). All healer's compete with one roper. I need to be able to enter into a mysql database these names, roper in one table and healer in another. Then once all the names are there make a round robin table. Once round robin table is made i also need to save a track time with that pair of people for each round. My skills with php are limited and looking for help to literally wright the code. Since I am doing this for him free of charge I am coming to you guys for help. Once everything for this is complete i plan on making it open source for download some where. Thanks
  13. What i am after is a round robin table that will sort lets say "cars", "drivers". so if i have 10 cars and 10 drivers i would end up with 10 different combos of cars and there driver. I am looking for ideas how to do this or if someone has code that does this aready. The end game for this round robin is to have all info registered into a mysql database along with it a lap time for around the track. So if car-6 and driver-2 have a lap time of 2 min i need to save this to a database. this would be for every slot in every round. Only idea i have come up with other than figuring out the code for the round robin is enter cars in one table, drivers in another. Use round robin code to generate the rounds and then have that saved to yet another table and from there display that info with functions to enter time. Ideas, code or links would be helpful Thanks
  14. Thanks for the help. Managed to get my form to write to different tables even though i am write the same info to each one. I just setup a html list menu to give option yes or no for the event field and used a if statement to not list the No people in a table.
  15. I think i understand what your saying but I have no clue how to go about it. The code i use i made for one thing and it just gets copied and pasted and changed for what i need. I don't know much about php other than to put basic forms into data base and pull it out. I am one of those i find the code make a test database and see how it works. Iike if/else php statement took me like 3 hours to figure it just the basic function to dispay info based on wheather or not any data was saved for that feild. I hate to ask but i would need to see the code to totally understand what your talking about and how it would work. I want to beable to click submit once and everything gets placed where it needs to. Thanks again.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.