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); ?>
×
×
  • 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.