Jump to content

Jim R

Members
  • Posts

    988
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Jim R

  1. This code works fine without the LIMIT 5, but it lists all the results. With the LIMIT $query = 'SELECT * FROM wp_playerRank WHERE year="2011" LIMIT 5 ORDER BY rankClass ASC'; $results = mysql_query($query); while($line = mysql_fetch_assoc($results)) { Here is the error I'm getting: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/jwrbloom/public_html/resources/players/rank2011_top5.php on line 26
  2. I "JUST" did that before the notification of your post came through. I had that as an issue on something else a year ago, and it took about three days to get it figure out. It works. Thank you. I'm definitely keeping this topic handy, as I like the exploding idea too for another project.
  3. Still getting the error. Warning: Wrong parameter count for str_replace() in /home/jwrbloom/public_html/resources/wp-playerProfile.php on line 62 Here is the code with the double quotes: echo '<ul>List: <li>'; 62 --> echo str_replace(",","</li>\n<li>" . $line['committed']); echo "\n</li>\n</ul>\n";
  4. Pikachu2000, I'm getting this error: Warning: Wrong parameter count for str_replace() in /home/jwrbloom/public_html/resources/wp-playerProfile.php on line 62 Using this code: echo '<ul>List: <li>'; echo str_replace(',','</li>\n<li>' . $line['committed']); echo '\n</li>\n</ul>\n';
  5. For where I would use it, the format would always be the same. It would be progressive, 2011, 2012, 2013, etc. I would Get the slug, such as commitment-2013, hopefully extract the 2013 part and use it to query another table.
  6. commitment-2011 is a slug via WordPress, and I can Get that from the database. However, I'd just like to use the 2011.
  7. Could the same be done with :: commitment-2011 I'd like to pass the 2011 as a variable.
  8. Is there a way to take data that is listed like a,b,c,d,e and turn that into an unordered list? Basically, I'm going to have a list of schools that will be listed with comma separators. I'll print that data out in two places, one will be printed as it's in the database. The other I would like to echo as an unordered list.
  9. Cancel the request. While I'm still not sure why it is like that or where to find it, I did add to the styles I could locate, and they override the mystery styles.
  10. My site: http://hoosierhoopsreport.com. The second row of navigation. It's the Custom Menu option that is relatively new in WordPress. The sub-menu items have gaps in between them, and the Recruiting 101 spacing is bad, forcing it to a second line. Using Firebug, it says the style can be found at http://hoosierhoopsreport.com#15 line 1696. As far as I can tell there is nothing that matches in any of my files. Any thoughts?
  11. Not sure if I posted this in the right board: As I'm setting up a plugin to parse Google Calendar events, when they are set as All Day events, they "end" at midnight, which pushes them into the next day. So if an event is to run All Day Friday, Saturday, and Sunday, it actually shows the end date as Monday, since it's midnight. Any thoughts?
  12. It's kind of like something I have. If they are fixed width and height, make sure the container DIV can fit two columns and make them all Float Left.
  13. Here is the site: http://hoosierhoopsreport.com If you scroll down, just above the footer on the right hand side are my image galleries. There is a gap, due to one of the titles being three lines instead of two. It only affects the left column. The DIVs are set to float left, and I want to get rid of that gap without changing the width or font size. I've tried bigger margins, as well as padding. Here is the CSS and code: <style type="text/css"> .menu-item { float: left; position: relative; width: 100px; font-weight: bold; line-height: 15px; font-size: 10px; padding: 5px; display: inline-block; } .menu-item a { font-weight: bold; color: #000; text-decoration: none; } .menu-item a:hover { text-decoration: underline; } </style> <div class="menu-item"> <a href="{=gallery.link}" title="{=gallery.title}"><img src="{=image.url}"{=image.output_width_tag}{=image.output_height_tag} alt="{=gallery.title}" />{=gallery.title}</a> </div>
  14. I'm not getting any error messages on the screen. It's not inserting to the database, so that much I know. I have zero experience with jQuery beyond setting up their tab GUI. Here is the site I took the sample from: http://webcache.googleusercontent.com/search?q=cache:WJ0Gt6UUqZUJ:www.9lessons.info/2009/11/insert-delete-with-jquery-and-ajax.html+jquery,+live,+insert+database&cd=7&hl=en&ct=clnk&gl=us&client=firefox-a Their demo works pretty well, which is linked on that page. Here is my test page. http://hoosierhoopsreport.com/live/
  15. Here is update_data.php if(isSet($_POST['content'])) { $content=$_POST['content']; mysql_query("insert into messages(msg) values ('$content')"); $sql_in= mysql_query("SELECT msg,msg_id FROM messages order by msg_id desc"); $r=mysql_fetch_array($sql_in); $msg=$r['msg']; $msg_id=$r['msg_id']; } ?> <li class="bar<?php echo $msg_id; ?<"> <div align="left"> <span ><?php echo $msg; ?> </span> <span class="delete_button"><a href="#" id="<?php echo $msg_id; ?>" class="delete_update">X</a></span> </div> </li> Here is delete_data.php if($_POST['msg_id']) { $id=$_POST['msg_id']; $id = mysql_escape_String($id); $sql = "delete from messages where msg_id='$id'"; mysql_query( $sql); }
  16. Not really any code of my own. I found an example online, copied it, made the changes to match my database, and it doesn't work. It uses jQuery too. Here is just the code on the page using the jQuery and the form: <link href="/resources/live_test/live_entry.css" rel="stylesheet" type="text/css"> <?php if(!$con = mysql_connect("localhost","######","######")) { die("Could not connect to database: ".mysql_error()); } mysql_select_db("jwrbloom_wpHHR", $con); ?> <script type="text/javascript" > $(function() { //Update Message... $(".update_button").click(function() { var boxval = $("#content").val(); var dataString = 'content='+ boxval; if(boxval=='') { alert("Please Enter Some Text"); } else { $("#flash").show(); $("#flash").fadeIn(400).html('<img src="ajax-loader.gif" align="absmiddle"> <span class="loading">Loading Comment...</span>'); $.ajax({ type: "POST", url: "update_data.php", data: dataString, cache: false, success: function(html){ $("ol#update").prepend(html); $("ol#update li:first").slideDown("slow"); document.getElementById('content').value=''; document.getElementById('content').focus(); $("#flash").hide(); } }); } return false; }); //Delete Message.. $('.delete_update').live("click",function() { var ID = $(this).attr("id"); var dataString = 'msg_id='+ ID; if(confirm("Sure you want to delete this update? There is NO undo!")) { $.ajax({ type: "POST", url: "delete_data.php", data: dataString, cache: false, success: function(html){ $(".bar"+ID).slideUp('slow', function() {$(this).remove();}); } }); } return false; }); }); </script> <div> <form method="post" name="form" action=""> <h3>What are you doing?</h3> <textarea name="content" id="content" maxlength="145" > </textarea> <input type="submit" value="Update" name="submit" class="update_button"/> </form> <div id="flash"></div> <ol id="update" class="timeline"> </ol> <div id='old_updates'> // Display old updates form messages table. </div>
  17. A basketball coach choose his School from a drop down list, which needs to be a constant throughout the rest of the data input on this page. Beneath that are Text Fields requesting a Player's name, class, height, and stats. Just one set of fields. Here is what I want. I want the coach, when he is done inputting the player's information, to hit ADD PLAYER button and have a blank set of Text Fields appear on the page without having left the page. It can show up just beneath it or in place of the old Text Fields. When he is done entering all the players, he hits the FINISHED button. I'm assuming the ADD PLAYER button is the one submitting the information to the database, and the FINISHED button just moves the coach beyond that screen or maybe submits the final player's information. I'm also assuming, as referred to above, the School selection stays constant throughout the whole process. 406 schools in a pre-populated drop down menu is not fun the scroll through 8-12 times. Easy enough, right? Riiiiiiiiiiiiiiiiight. : ) Can anyone help me with this or throw me in a great direction for help?
  18. Thanks. That did the trick. Clearly I haven't had much experience with arrays either.
  19. I have a column in my MySQL database "paid". I have values of p for PayPal, c for check, and f for free. Those who haven't paid the record is marked (NULL). Right now my code is: if ($line['paid'] == 'y') { echo '.</center></td>';} else { echo '</center></td>';} That works pretty well for when I was just using those who paid vs. those who didn't. However, I'm wanting my site to show who has paid vs. those who haven't, while my data table will easily show how they paid. I either need an array or I need to reverse the IF...ELSE to say IF it's NULL do nothing, ELSE mark paid.
  20. I'm just not familiar at all at how triggers work.
  21. It's ultimately what WordPress uses to create their permalinks.
  22. Not sure what you mean by that. I just need to have that slug value so WP can match it.
  23. YES...that's where I was going with my request. I'm just up with all (or much) terminology. If it was a spread sheet, I'd have =[column A]-[column B] (I need the hash in between) Is it simple like that, or should I just start digging around?
  24. It should be. Such a simple spreadsheet function, it would be nice to apply that type of setting.
  25. Additionally, I'm not inserting. I'm typing directly into my database, via SQLyog--a great tool. I was hoping I could set a default value for a column based on the variable output of two other columns. You're saying that is not the case?
×
×
  • 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.