Jump to content

ShopMAster

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Everything posted by ShopMAster

  1. Hey Guys, I'm running a league where there are 4 teams of 6 players and the players face off at different stadiums in specific games. For example Team 1 plays Team 2 @ Stadium 1 in a kickball game - Team 1 Wins Team 2 plays Team 3 @ Stadium 1 in a softball game - Team 2 Wins Team 1 plays Team 3 @ Stadium 1 in a kickball game - Team 1 Wins With that said how should I set up the Stadium Table? The Stadium will have 5 events that a team can score in and a team can score multiple times in any event. Do I need to set up an event table and if so how should that be laid out (I'm thinking ID, name of event, and rules) and how should the Stadium table be laid out? In my mind I see what I want to display where it's like a grid of a stadium, the events in a row at the top and the teams in a column on the left and then the number of victories for the team and event. thanks for your help.
  2. I'm sorry I'm kind of new but where would I put: session_set_cookie_params(.., '/', 'www.mydomain.com', ..); session_set_cookie_params(.., '/', 'newapplication.mydomain.com', ..); I know I set cookies in the config file for the application that's running on the root of the domain and I know I'm not setting cookies for the new application. Do I put it in the header? Thanks for any assistance.
  3. Hello, You guys have always helped me so I'm coming to you guys again for some help. I have a site that requires people to login using a username and password. It's at www.mydomain.com. I have built another application that uses a login system also at the same domain name just in a folder Ex. www.mydomain.com/newapplication/ When I sign into the newapplication (www.mydomain.com/newapplication/) and then open up another window with IE and go to the first application (www.mydomain.com) it has me already signed in as someone else. Is there anyway to prevent this? I'm new at this but I'm thinking there has to be a way to solve this. Any help is really appreciated. Thanks. - ShopMaster
  4. schilly, thank you from the bottom of my heart. It worked like a charm. You da man! - Shop
  5. Hello Coders, I'm having some trouble with this and maybe you can help me out. I'm displaying the last 15 days in a dropdown list but I can't figure out how to exclude the weekends (Sat and Sun) from that list. I'm kind of new to this whole PHP stuff so any help would be very much appreciated: Here is what I have <form name="form" id="form"> <select name="jumpMenu" id="jumpMenu"> <option value="#">Select Day</option> <?php $m= date("m"); $de= date("d"); $y= date("Y"); for($i=0; $i<=15; $i++){ echo "<option value=daytest.php?dateselect=" . date('mdy',mktime(0,0,0,$m,($de-$i),$y)) . "&day=" . date('F d, Y',mktime(0,0,0,$m,($de-$i),$y)) . "'>" . date('D, F d, Y',mktime(0,0,0,$m,($de-$i),$y)) . "</option>"; } ?> </select> <input type="button" name="go_button" id= "go_button" value="Go" onclick="MM_jumpMenuGo('jumpMenu','parent',0)" /> </form> Thanks for your guidance.
  6. I'm running into a problem and I know it's something simple but I can't figure it out. I have a form which asks for month and year and is stored in cc_exp_mo and cc_exp_year. I need to put both of those values together so 11 10 becomes 1110 and put it in one value: This is my code where I'm trying to do it: "x_card_num" => $_POST['cc_number'], "x_exp_date" => $_POST['cc_exp_mo'] && $_POST['cc_exp_yr'], <--- "x_amount" => $_POST['total_amt'], "x_first_name" => $_POST['cc_name'], Now I don't want to do the form over because there is some script attached and I don't want to fool with it. So how can I set the x_exp_date to show both the post for month and year? I appreciate the help. Shop
  7. That's the thing I don't know how to get the username by querying the db. I'm already querying one database to pull in all the information on the following page. If you go here: http://www.mymaddenpad.com/?L=stats.ps3stats You'll see stats and in the top right hand you'll see the latest matches. FratGQ 20 vs. MWShop 14 FratGQ and MWShop are gamertags, not users on the site. Shopmaster's gamertag is MWShop and is defined in the users table in the ps3persona field on a different database than where this data is being pulled from. 1. How do I select the other database? 2. How do I select the username (Shopmaster) from a different database and display it instead of MWShop. Any help would be appreciated.
  8. Ok, I have a script that I need some assistance with. I have two databases and there is a field in both that should have the same info. In the first database I have a table called a02_match_stats and there is a player_name field that should match another field (ps3persona) in another table (users) which is in another database. How do I use the script below to call the username (in the users table) instead of player_name. Example. Database 1 --> table (a02_match_stats) --> field (player_name) = MWShop Database 2 --> table (users) ----> field (ps3persona) = MWShop ---> field (username) = Shopmaster I want to replace the player_name with username. Hope I didn't lose anyone. <?PHP $tko=mysql_query("SELECT * FROM a02_match_stats ORDER by id DESC"); $conki=0; while ($kt=mysql_fetch_array($tko) AND $conki<10) { $conki++; $tt=mysql_fetch_array($tko); echo '<tr bgcolor="#FFFFFF"><td><a href="history.php?id='.$kt[id_player].'">'.$kt[player_name].'</a></td> <td>'.$kt[sBT].'</td><td>vs.</td><td><a href="history.php?id='.$tt[id_player].'">'.$tt[player_name].'</a></td><td>'.$tt[sBT].'</td></tr>'; } /*echo '<tr><td>player1</td> <td>(score)</td><td>vs.</td><td>player2</td><td>(score)</td></tr>'; echo '<tr bgcolor="#FFFFFF"><td>player1</td> <td>(score)</td><td>vs.</td><td>player2</td><td>(score)</td></tr>'; echo '<tr><td>player1</td> <td>(score)</td><td>vs.</td><td>player2</td><td>(score)</td></tr>'; echo '<tr bgcolor="#FFFFFF"><td>player1</td> <td>(score)</td><td>vs.</td><td>player2</td><td>(score)</td></tr>'; echo '<tr><td>player1</td> <td>(score)</td><td>vs.</td><td>player2</td><td>(score)</td></tr>'; echo '<tr bgcolor="#FFFFFF"><td>player1</td> <td>(score)</td><td>vs.</td><td>player2</td><td>(score)</td></tr>'; echo '<tr><td>player1</td> <td>(score)</td><td>vs.</td><td>player2</td><td>(score)</td></tr>'; echo '<tr bgcolor="#FFFFFF"><td>player1</td> <td>(score)</td><td>vs.</td><td>player2</td><td>(score)</td></tr>';*/ ?> Thanks for the help. Shop
  9. Ok I have a dedicated server and I updated my php.ini file to increase the max_upload parameter. I save it but everytime I look at the phpinfo() it hasn't changed and it's still reading from an old date. Do I have to restart the PHP application and if so how do I do that? I'm running Plesk from 1and1 Hosting. Thanks. - Shop
  10. Nope, did't work. the file is in mwtheleague/index.php the include includes/mainnav_hd.php
  11. Don't use a url, use an absolute path. I'm sorry, I'm a newbie. What is an absolute path? or how do you code the ini_set("URL_FOPEN",true);
  12. That is poor advice. Fix your code! eg; if ($submit) { should be.... if ($_POST['submit']) { These changes where made default in php4. Also, calling mysql_query() multiple times like that is very infificient, esecially when your queries can be combined into much fewer. I tried that and now I'm getting the following error: PHP Notice: Undefined index: submit in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 10 PHP Notice: Undefined index: delete in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 45 PHP Notice: Undefined index: id in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 60 PHP Notice: Undefined index: id in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 86 PHP Notice: Undefined index: random_wscore in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 132 PHP Notice: Undefined index: random_lscore in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 145 PHP Notice: Undefined index: random_comment in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 149
  13. My host upgraded to 5.2.4 and now all my include files are not showing up on my pages. Here is how I am defining the include statements: <? // include header image include('http://www.maddenwars.com/includes/mainnav_hd.php'); ?> I looked at the documentation but I can't seem to find out the correct way to include files. Thanks guys.
  14. Where do I add that and what is the correct syntax?
  15. My hosting company upgraded from 5.2.3 to 5.2.4 I'm getting the following errors now: PHP Notice: Undefined variable: submit in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 20 PHP Notice: Undefined variable: delete in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 55 PHP Notice: Undefined variable: id in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 70 PHP Notice: Undefined variable: id in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 96 PHP Notice: Undefined variable: random_wscore in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 142 PHP Notice: Undefined variable: random_lscore in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 155 PHP Notice: Undefined variable: random_comment in D:\domains\maddenwars.com\wwwroot\randomgamesshop3.php on line 159 Here is the code: <?php $db = mysql_connect("mysql.mydbserv.com", "*****", "*****"); mysql_select_db("DB_name",$db); if ($submit) { // here if no ID then adding else we're editing if ($id) { mysql_query("UPDATE random_games SET random_winner='$random_winner',random_wscore='$random_wscore',random_loser='$random_loser',random_lscore='$random_lscore',random_comment='$random_comment' WHERE id=$id"); mysql_query("UPDATE players SET player_win = player_win + 1 where player_name = '".$_POST['random_winner']."' "); mysql_query("UPDATE players SET player_loss = player_loss + 1 where player_name = '".$_POST['random_loser']."' "); mysql_query("UPDATE players SET player_lastw = '".$_POST['random_loser']."' where player_name = '".$_POST['random_winner']."' "); mysql_query("UPDATE players SET player_lastl = '".$_POST['random_winner']."' where player_name = '".$_POST['random_loser']."' "); mysql_query("UPDATE standings SET random = random + 1 where name = 'Shop'"); mysql_query("UPDATE standings SET total = total + 1 where name = 'Shop'"); } else { $sql = "INSERT INTO random_games (random_winner,random_wscore,random_loser,random_lscore,random_comment) VALUES ('$random_winner','$random_wscore','$random_loser','$random_lscore','$random_comment')"; mysql_query("UPDATE players SET player_win = player_win + 1 where player_name = '".$_POST['random_winner']."' "); mysql_query("UPDATE players SET player_loss = player_loss + 1 where player_name = '".$_POST['random_loser']."' "); mysql_query("UPDATE players SET player_lastw = '".$_POST['random_loser']."' where player_name = '".$_POST['random_winner']."' "); mysql_query("UPDATE players SET player_lastl = '".$_POST['random_winner']."' where player_name = '".$_POST['random_loser']."' "); mysql_query("UPDATE standings SET random = random + 1 where name = 'Shop'"); mysql_query("UPDATE standings SET total = total + 1 where name = 'Shop'"); } // run SQL against the DB $result = mysql_query($sql); echo "<font face=Verdana size=2>Record updated/edited! <a href=http://www.maddenwars.com/randomgamesshop3.php>Go Back to Random Stat Entry page!</a><p>"; } elseif ($delete) { // delete a record $sql = "DELETE FROM random_games WHERE random_gmid=$random_gmid"; $result = mysql_query($sql); echo "$sql Record deleted! <a href=http://www.maddenwars.com/randomgamesshop3.php>Go Back to List</a><p>"; } else { // this part happens if we don't press submit if (!$id) { // print the list if there is not editing $result = mysql_query("SELECT * FROM random_games ORDER BY random_gmid",$db); // while ($myrow = mysql_fetch_array($result)) { } } ?> <P> <!-- <form action="../mwleague/handle_game.php" method="post"> --> <form method="post" action="<?php echo $PHP_SELF?>"> <?php if ($id) { // editing so select a record $sql = "SELECT * FROM random_games WHERE id=$id"; $result = mysql_query($sql); $myrow = mysql_fetch_array($result); $id = $myrow["id"]; $random_winner = $myrow["random_winner"]; $random_loser = $myrow["random_loser"]; $random_wscore = $myrow["random_wscore"]; $random_lscore = $myrow["random_lscore"]; $random_comment = $myrow["random_comment"]; // print the id for editing ?> <input type=hidden name="random_gmid" value="<?php echo $random_gmid ?>"> <?php } ?></font><b><font face="Verdana" size="4" color="#0000FF">Random Game Entry</font></b><font face=Verdana size=2><br> <br> <font color="#000000">Winner: <select name="random_winner" size="1"> <?php $random_winner = mysql_query("SELECT * FROM players WHERE player_team = 'Shop' ORDER BY player_perc DESC",$db); while ($arr = mysql_fetch_assoc($random_winner)) { echo "<option value=\"".$arr['player_name']."\">".ucfirst($arr['player_name'])."</option>"; } ?> </select> </font> <input type="Text" name="random_wscore" value="<?php echo $random_wscore ?>" size="2">winning score<br><br> defeated<br> <br> <font color="#000000">Loser: <select name="random_loser" size="1"> <?php $random_loser = mysql_query("SELECT * FROM players WHERE player_team != 'Shop' ORDER BY player_name ASC",$db); while ($arr = mysql_fetch_assoc($random_loser)) { echo "<option value=\"".$arr['player_name']."\">".ucfirst($arr['player_name'])."</option>"; } ?> </select> </font><input type="Text" name="random_lscore" value="<?php echo $random_lscore ?>" size="2">losing score</font><p><font face=Verdana size=2><br> Comments:<br> <textarea rows="3" name="random_comment" cols="32" value="<?php echo $random_comment ?>"></textarea><br> <input type="Submit" name="submit" value="Enter information"> <br> (</font><font face="Verdana" size="1">press button once, takes time to process)</font> </p> </form> <font face=Verdana size=2> </font> <?php } ?> What do I need to change in order to fix those errors?
  16. Thanks. Looks like I'm going to have to look at getting a Freelancer for this.
  17. I'm fairly new to PHP, but I was wondering if there is a way to execute Linux commands via a PHP Script. Here's my delima. I want to run a cron job that runs a php script that renames all the files in a directory and then move those files to a different directory.
  18. Thanks guys for the help. Problem solved.
  19. btw - Barand, that worked, except for the 0 thing.
  20. I get the following error when the count is 0; Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 16 in D:\Domains\mwchallenge.com\wwwroot\myfeedback.php on line 27 how do I just display 0 when I do <?=$nrfn?>
  21. Here is the code I'm using. The first one should give me the # of members who gave a positive feedback and the second for negative feedback. Both should only give me a count for unique 'giver' fields, correct? $nrfn = mysql_result ( mysql_query("select count(*) as nr from feedback where rec ='".$_SESSION['id']."' and rating = 3 GROUP BY giver") ,0,"nr" ); $nrfp = mysql_result ( mysql_query("select count(*) as nr from feedback where rec ='".$_SESSION['id']."' and rating = 1 GROUP BY giver") ,0,"nr" );
  22. I track members in the field 'giver' but when I put that in there it still is giving me two rows for one person giving 2 feedbacks. Also when no one has given a feedback I get : Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 16 in D:\Domains\mwchallenge.com\wwwroot\myfeedback.php on line 27 Shouldn't it return 0 using the code above?
×
×
  • 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.