Jump to content

onthespot

Members
  • Posts

    424
  • Joined

  • Last visited

    Never

Everything posted by onthespot

  1. <td><? echo awards($type);?></td> I did that and now have them going horizontally. However, they are just running off my page and going far to far to the right?
  2. How can I put <td> tags around this echo awards($type); That might sort this for me?
  3. At the moment, the echo is for one and then it goes down and does it again on the next line, how can i get 10 per line, before going down to the next 10 underneath?
  4. That lists then. I am after them going 1 2 3 4 5 6 7 8 , rather than 1 2 3 4 5 6 7 8 any ideas?
  5. Ok so I posted this in HTML, but got no replies and thought it may be something to do with the PHP side of things. <table><tr><td> <b><u>Awards:</u></b></td></tr> <tr><td><br> <?php function awards($type) { $images = array ( 'league1' => 'first.jpg', 'league2' => 'second.jpg', 'league3' => 'third.jpg' ); if(array_key_exists($type, $images)) return '<img src="images/awards/'.$images[$type].'" width="12" height="27" />'; return false; } $awarduser = mysql_real_escape_string($req_user_info['username']); $res=mysql_query("SELECT * FROM ".TBL_AWARDS." WHERE awarduser = '$awarduser' ORDER BY awarddate"); while($row=mysql_fetch_assoc($res)){ $type=$row['awardtype']; echo awards($type); } ?> </td></tr> </table> Each award should be displayed across the page, right? But at the moment each award just goes below the one above. How can i correct this?
  6. Solved, was linking to the activation php file wrong that was all, sorry for wasting your time
  7. ok sorry the first query WORKS though. I tried the following $stats1 = "INSERT INTO fifa09_stats (user, home_games_played, home_wins, home_draws, home_losses, home_goals_for, home_goals_against, home_points, away_games_played, away_wins, away_draws, away_losses, away_goals_for, away_goals_against, away_points) VALUES ('$user', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; still didnt have any joy?
  8. What do you mean? The query that enters the users into the database works perfectly. But the 4 queries after dont seem to work?
  9. Hey cheers, I do know though that this can work, it did earlier in a different situation, so the SQL isn't the problem. I believe it's how I am running the queries?
  10. <?php $query="UPDATE ".TBL_USERS." SET userlevel = 1 WHERE username = '$user'"; $stats1 = "INSERT INTO fifa09_stats VALUES ('$user', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; $stats2 = "INSERT INTO fifa10_stats VALUES ('$user', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; $stats3 = "INSERT INTO pes09_stats VALUES ('$user', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; $stats4 = "INSERT INTO pes10_stats VALUES ('$user', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; if (md5($user) == $act){ mysql_query($query) or die(mysql_error()); mysql_query($stats1) or die(mysql_error()); mysql_query($stats2) or die(mysql_error()); mysql_query($stats3) or die(mysql_error()); mysql_query($stats4) or die(mysql_error()); echo "Congratulations, activation complete. You may now log in and enjoy all of our features."; } else { echo "We are sorry, but this activation request doesn't exist"; } ?> I changed the code to that, and ran it, didn't get an error, but still didn't populate the tables?
  11. This is my code <?php $query="UPDATE ".TBL_USERS." SET userlevel = 1 WHERE username = '$user'"; $stats1 = "INSERT INTO fifa09_stats VALUES ('$user', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; $stats2 = "INSERT INTO fifa10_stats VALUES ('$user', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; $stats3 = "INSERT INTO pes09_stats VALUES ('$user', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; $stats4 = "INSERT INTO pes10_stats VALUES ('$user', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; if (md5($user) == $act){ mysql_query($query); mysql_query($stats1); mysql_query($stats2); mysql_query($stats3); mysql_query($stats4); echo "Congratulations, activation complete. You may now log in and enjoy all of our features."; } else { echo "We are sorry, but this activation request doesn't exist"; } ?> The $query variable works perfect, but the other 4 don't work? Any ideas?
  12. Well Im asking if you can display the queries in the way I am?
  13. <?php $q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', $time, '$name1', now(), '$location', '$x360gt', '$ps3gt', '$pcgt', 'Write your own comment')"; $stats1 = "INSERT INTO fifa09_stats VALUES ('$username', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; $stats2 = "INSERT INTO fifa10_stats VALUES ('$username', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; $stats3 = "INSERT INTO pes09_stats VALUES ('$username', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; $stats4 = "INSERT INTO pes10_stats VALUES ('$username', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"; } return mysql_query($q, $this->connection); mysql_query($stats1, $this->connection); mysql_query($stats2, $this->connection); mysql_query($stats3, $this->connection); mysql_query($stats4, $this->connection);?> That isn't working, it's not letting the user register which means there is an error. Can you tell me if i am doing this correctly?
  14. hey, i have a competitions table and a archive table. they are identical in structure I am looking to create an SQL function that will take the row from competitions, place it in archive and delete it from compeittions. How would I go about doing this?
  15. Hey guys, I have the following code. <table> <tr> <td> <b><u>Awards:</u></b> </td> </tr> <tr> <td> <?php function awards($type) { $images = array ( 'league1' => 'first.jpg', 'league2' => 'second.jpg', 'league3' => 'third.jpg' ); if(array_key_exists($type, $images)) return '<img src="images/awards/'.$images[$type].'" width="12" height="27" />'; return false; } $awarduser = mysql_real_escape_string($req_user_info['username']); $res=mysql_query("SELECT * FROM ".TBL_AWARDS." WHERE awarduser = '$awarduser' ORDER BY awarddate"); while($row=mysql_fetch_assoc($res)){ $type=$row['awardtype']; echo awards($type); } ?> </td> </tr> </table> Each award shows down the page vertically, I want them to go across the page horizontally. Please help
  16. <?php $res=mysql_query("SELECT username FROM ".TBL_USERS." WHERE username != '".$_SESSION['username']."'") or die(mysql_error()); while($row=mysql_fetch_assoc($res)){ $username=htmlspecialchars($row['username']); echo "<option value=\"$username\">$username</option>"; } ?> This is my existing code which brings up all users from my database. Howver I want to be able to reply to messages, or put links on profiles for SEND PM, to that specific user. How could I edit this code so that it will preselect the appopriate user from the dropdown?
  17. If i did that, when they want to send a message just from the pm system itself without the GET, would it just default to the top of the list? So would doing it your way in effect make the dropdown select the correct player? How would this work if i wanted to reply? Use the from part of the message and GET that too?
  18. Yeah thats a way I could use. Is there a way to select a user from the dropdown menu already on offer though?
  19. Hey guys, I have a fully functional messaging system. What I am now trying to do is provide a direct link on users profiles for them to PM someone. Obviously this would bring up the new_message.php page, but the dropdown menu would have the player that they want to message automatically selected. How would I go about doing this? What code would I need to supply for you to help me on this? Thanks
  20. I only want it to display the leagues that have fixtures left for the user that is viewing them to play. If there arent any fixtures, I dont want that competition to be displayed
  21. Hey guys. My code is designed to take the comp_name field from table COMPETITIONS and check the FIXTURES table field COMP for any fixtures where the comp field is the same as comp_name from competitions table and also where the user is the home or away user in the fixtures table. If rows are found, then the idea is for whatever row is found to be displayed on the fixtures.php page. The following is my code so far. <?php // select all league competitions $competition = ("SELECT `comp` FROM `competitions` WHERE `comp_type` = 'league' "); // user for this part of competition on site $user = $_SESSION['username']; // take the competitions and check if there are any fixtures in the fixture table with this name $comp = mysql_query("SELECT `comp` FROM `fixtures` WHERE `comp` = '$competitions' AND `home_user` = '$user' OR `away_user` = '$user' "); $num_rows = mysql_num_rows($comp); // if there are, select them from the competitions table and display if ($num_rows > 0) { $leagues = mysql_query("SELECT `comp_name`, `game`, `format` FROM `competitions` WHERE `comp_type` = 'league' AND `comp_name` = '$competition'"); echo"<table cellspacing=\"10\"> <tr> <td>Competition</td> <td>Game</td> <td>Format</td> </tr>"; while( $row = mysql_fetch_assoc($leagues)) { extract($row); $info = explode("_",$row[comp_name]); echo" <tr> <td><A HREF='leaguefix.php?comp=$comp_name'>$info[2]</A></td> <td>$info[1]</td> <td>$info[0]</td> </tr>"; } echo"</table>"; echo mysql_error(); } else { } ?> mysql_num_rows isnt working?
  22. <?php $competition = ("SELECT comp FROM competitions WHERE comp_type = 'league' "); $user = $_SESSION['username']; $comp = mysql_query("SELECT '$competition' FROM `fixtures` WHERE `home_user` = '$user' OR `away_user` = '$user' "); $num_rows = mysql_num_rows($comp); if ($num_rows > 0){ $leagues = mysql_query("SELECT `comp_name`, `game`, `format` FROM `competitions` WHERE `comp_type` = 'league' AND `comp_name` = '$competition'"); echo"<table cellspacing=\"10\"> <tr> <td>Competition</td> <td>Game</td> <td>Format</td> </tr>"; while( $row = mysql_fetch_assoc($leagues)) { extract($row); $info = explode("_",$row[comp_name]); echo" <tr> <td><A HREF='leaguefix.php?comp=$comp_name'>$info[2]</A></td> <td>$info[1]</td> <td>$info[0]</td> </tr>"; } echo"</table>"; echo mysql_error(); } else {} ?> Thats what I have come up with. I have taken the name of the comp from competitions, checked if that comp has any rows in fixtures and if it does, perform the code. Getting an error though?
×
×
  • 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.