Jump to content

Smackie

Members
  • Posts

    48
  • Joined

  • Last visited

    Never

Everything posted by Smackie

  1. i couldn't find the edit button if there was one.. but i have a problem :-\ even just your script its not working on my local server nor my website server am i doing something wrong?
  2. hmm thats what i thought.. but my script isn't working right or my server isn't liking it but thanx.
  3. I have been away from PHP for too long lol.. I am have a script that shows Decimals and i want to make it so if after the decimal is 0 it doesn't show the decimal? can someone help me please Thank you Smackie
  4. I am having no luck here. anyone got a clue on why its not showing anything thats its suppose to?
  5. Greetings, now i just ran into a new problem i might be over looking alittle bit but not sure.. here is the script i have now. $top_scorers = array(); $query_users = "SELECT user_name FROM users ORDER BY user_name"; $result_users = mysql_query($query_users); while ($line = mysql_fetch_array($result_users)) { $user_name = $line['user_name']; $total = 0; $query_scores = "SELECT r1.total, r1.bonus, r2.total2, r2.bonus2, r3.total3, r3.bonus3 FROM reports as r1 JOIN reports2 as r2 ON r1.user_name = r2.user_name JOIN reports3 as r3 ON r3.user_name = r2.user_name WHERE MONTH(r1.date)=$today_month AND YEAR(r1.date)=$today_year AND MONTH(r2.date)=$today_month AND YEAR(r2.date)=$today_year AND MONTH(r3.date)=$today_month AND YEAR(r3.date)=$today_year"; but when i check the page out it shows no user_name and has no scores but when i look at the totals for everyone it shows 22.. thats from a test report i did.. to see what im talking about check out http://69.66.65.137/index.php?seashadows=monthly-score it should look more like http://seashadows.org/index.php?seashadows=monthly-score only thing is the seashadows link is set for only 1 database.. thank you Smackie
  6. yeah i figured it out lol i better hit the sack so i can get a fresh start on this page.. thank you all for your help.. Smackie
  7. what im tring to retrieve is the Month on one and the Year on the other.. it should be looking for all the users posted a report in Month/Year.. but its suppose to be set for current month then at the bottom users can view older months and years to see how active our group is. if you look at http://www.seashadows.org/index.php?seashadows=monthly-score you would see the script working properly (but thats only 1 table being used which is reports and well we just added 2 new games and needing the monthly score to show users scores altogether in one showing.
  8. ok but not sure how date would effect that... how can i fix this? thats a first time i ever got that lol but up at the top of my page i got this code for the date.. not sure if it might have something to do with the ambiguous <?php include 'db.php'; $today_date = date("m/Y"); if (($_REQUEST['month'] == 99) || (!$_REQUEST['month'])) { $today_month = date("m"); } else { $today_month = $_REQUEST['month']; } if (($_REQUEST['year'] == 9999) || (!$_REQUEST['year'])) { $today_year = date("Y"); } else { $today_year = $_REQUEST['year']; } ?> and thanx for saying to add "or die(mysql_error()); i should have remember it..
  9. Greetings mates, I'm trying to join 2 tables together to show the totals for each member each month. $top_scorers = array(); $query_users = "SELECT user_name FROM users ORDER BY user_name"; $result_users = mysql_query($query_users); while ($line = mysql_fetch_array($result_users)) { $user_name = $line['user_name']; $total = 0; $query_scores = "SELECT r1.total, r1.bonus, r2.total2, r2.bonus2 FROM reports as r1 JOIN reports2 as r2 ON r1.user_name = '$user_name' WHERE r1.user_name = r2.user_name AND MONTH(date)=$today_month AND YEAR(date)=$today_year"; $result_scores = mysql_query($query_scores); while ($line = mysql_fetch_array($result_scores)) { $total_score2 = $line['total']; $bonus = $line['bonus']; $total_score = $bonus + $total_score2; $total += $total_score; } $top_scorers[$user_name] = $total; $month_total += $total; } I know im probably doing something not right but not sure but im getting this warning now the join starts from the $query_score, I hope someone can help me figure this one out.. thank you Smackie
  10. well right now im using Xampp so i don't need to worry about permissions lol but yeah i know about permissions to do that but see im not sure on how i would do the mkdir() using my register script..
  11. Greetings, I'm alittle new to mkdir lol.. here is what im wanting to do. When a user signs up for my site (after the fill in the fields and press submit) it will send them to a new page. which will send there data to database. how can i make it where it will create a new sub folder in say users sub folder..? Sorry if i confused ya there. basically when a user signs up it will create a sub folder (named Smackie) it will put it in users so say it would be www/users/Smackie or however the path is.. how can i do this? Thank you Smackie
  12. Well if your talking about the news you can always do this. if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } $max_results = 5; $from = (($page * $max_results) - $max_results); $sql = "SELECT * FROM table WHERE Whatever = 'whatever' ORDER BY whaterver DESC LIMIT $from, $max_results"; } $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM table WHERE whatever = 'whatever'"),0); $total_pages = ceil($total_results / $max_results); echo "<center>"; if($page > 1){ $prev = ($page - 1); echo "<font class=\"txt\"><a class=\"two\" href=\"".$_SERVER['PHP_SELF']."?page=$prev\">Previous</a>&nbsp|&nbsp</font>"; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "<font class=\"txt\" color=\"#796F51\">$i </font>"; } else { echo "<font class=\"txt\"><a class=\"two\" href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a>&nbsp</font>"; } } if($page < $total_pages){ $next = ($page + 1); echo "<font class=\"txt\">&nbsp|&nbsp<a class=\"two\" href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next</a></font>"; } This willl output 5 news posts on each page.
  13. I am trying to update the datetime2 in my database here is my query. $sql = "UPDATE forum_question SET datetime2 = now() WHERE id='id'"; $result = mysql_query($sql); The reason why im trying to update this is so that my forum will be showing the last date and time a post was posted in that forum. Thank you, Smackie
  14. Why not take a look at some tutorials on php calendars they will show you how to accually make it where you don't have to update it.
  15. Well its someone of a success lol. i mean it hides the Promotion Review Board but wont show even for me.. here is what i got now as the if statement. if ($_SESSION[user_level]) { $get_category = mysql_query("SELECT * FROM category WHERE access <= $_SESSION[user_level] GROUP BY id") or die(mysql_error()); } else { $get_category = mysql_query("SELECT * FROM category WHERE access = 0 GROUP BY id") or die(mysql_error()); } while($row = mysql_fetch_array($get_category)) {
  16. That seems good ill try that out but i have level as user_level which there are 6 but 0 is deactivated users and yes my password is MD5() hehe.. but let me work on that and add access and see what i come up with.. Thank you blueman
  17. is the images in a folder? if so your going to need to do this.. (example folder images) { background-image:url('<?php $thumbnum = $_GET['thumb']; echo 'images/'.thumbnum.'; ?>.jpg') background-repeat: no-repeat; background-attachment: fixed; background-position: center; } just taking a guess problem lol not sure if it will work.
  18. first off let me say putting images and/or videos into mysql is a waste of mysql space. why not put the images or your videos on your server, create a database that holds all the urls of the images and videos and create a query that will call upon them and output them or even links? like say you want to call up an image <?php $sql = "SELECT images FROM database ORDER BY id"; $result = mysql_query($sql); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo '<img src="images/'.image.'">'; } ?> btw i threw this together so not sure if it will work right but.. as you can see it will call out all the images by id.. but it will give you an idea of what im talking about.
  19. Just a quick question for you tronicsmasta why use comments.username why not change it over and use like c.username saves on typing so much lol. but good to see you got things worked out
  20. i see what you mean by iframes in forum yes i know about that working on bbcoding for it and once i get bbcoding on there it will deal away with the allowing html inputs. but im still looking on fixing the viewing files from each folder. but the forum im still working the access to it.. but i should have added this earlier but i was alittle hot from working outside getting everything cleaned up after the bad storm we had last night.. but thank you for the tips.. but can you give me a tip on how to get my category to work like i need it? lol
  21. first off seashadows.uni.cc is located on my hard drive its my testing area.. second off your only showing me the error log file i already new about which was caused from me changing something in the script and yeah. and change password im still working on that. like i said this is on my testing server. and another thing i don't use iframes i never have and never will.. i use tables.. and this site (when i say this site. i mean the real site) is only for people that play Dangerous Waters. but none of this is helping me solve my forum problem.
  22. i don't want the page to be hidden from members.. i just want one of the catagories hidden from the members except for the people i let be in there. i have user_level set 0-5 but that ain't what i need. but think you anywaysBlueSkyIS
  23. Greetings, I been working on a forum. its almost complete.. but im having a problem (btw this forum is for only my site). I am calling all the categories out from a while loop and was wondering if someone could tell me how i can some of the categories were only selected members can view thie topics and stuff.? here is the page.. <table width="100%" height="20" border="0" bgcolor="000033" cellpadding="2" cellspacing="0"> <tr> <th class="txt" width="80%">Forum</th> <th class="txt" width="10%">Topics</th> <th class="txt" width="10%">Post</th> </tr> </table> <?php $get_category = mysql_query("SELECT * FROM category GROUP BY id") or die(mysql_error()); while($row = mysql_fetch_array($get_category)) { ?> <table width="100%" height="20" border="0" bgcolor="00255d" cellpadding="2" cellspacing="0"> <tr> <th class="txt" width="60%" align="left"><B><U><font size="2"><?php echo $row['category']; ?></font></u></b></th> </tr> </table> <table width="100%" border="1" bordercolor="CFC095" bgcolor="000033" cellpadding="3" cellspacing="0"> <?php $id = $_GET['id']; $get_topic = mysql_query("SELECT * FROM header WHERE catid=" . $row['id'] . " ORDER BY catid") or die(mysql_error()); while($topic_info = mysql_fetch_array($get_topic)) { $id = $topic_info['id']; $catid = $topic_info['catid']; $heading = stripslashes($topic_info['heading']); $description = $topic_info['description']; $get_num_topics = mysql_query("SELECT catid FROM forum_question WHERE catid = $catid"); $topics = mysql_num_rows($get_num_topics); $get_num_posts = mysql_query("SELECT catid FROM forum_answer WHERE catid = $catid"); $posts = mysql_num_rows($get_num_posts); ?> <tr> <td class="txt" width="80%" align="left"><a href="../index.php?seashadows=topic&catid=<?php echo $catid; ?>&id=<?php echo $id; ?>"><?php echo $heading; ?></a><br /><?php echo $description; ?></td> <td class="txt" width="10%"><?php echo $topics; ?></td> <td class="txt" width="10%"><?php echo $posts; ?></td> <?php if($_SESSION['user_level'] == 5) { ?> <tr> <td class="txt" align="right" colspan="3"><a class="two" href="../index.php?seashadows=header_functions&id=<?php echo $id; ?>">Edit</a> | <a class="two" href="../index.php?seashadows=header_functions&action=delete1&id=<?php echo $id; ?>">Delete</a></td> </tr> <tr> <td class="txt" align="right" colspan="3"><a href="../index.php?seashadows=add_heading"><strong>Create New Subject</strong></a></td> </tr> <?php } } } ?> </table> here is what the page looks like http://seashadows.uni.cc/index.php?seashadows=forum i need Promotion Review Board to only be shown to people who are selected. Thank you, Smackie
  24. First off wins draws and kills do not add up to how many games each user played. because user could get more then 1 kill in a game. the way i need it is to add up how many user_names that are the same like say Smackie and its in there 5 times ok so the out put would be 5 games
  25. Hello I am trying to get a script going so it will output the user's name, number of games, number of kills, number of draws ect. well my database table has id, user_name, kills, wins, draws, and bonus. i need to have it where it loops so it shows each user and their games, kills, wins, draws, and bonus. been trying to figure this out for days and ill i can get is it outputs all the users names (more then once) and the games go from 1 to how many id's there are :-\ but here is what i came up with from looking at different tutorials..
×
×
  • 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.