Jump to content

Greaser9780

Members
  • Posts

    326
  • Joined

  • Last visited

    Never

Everything posted by Greaser9780

  1. When you do your mysql query call for the rest of the information in that row at the same time. $sql = "SELECT * FROM information `number`, `first`, `last`, WHERE number = '$number'"; $result = mysql_query($sql) or die(mysql_error()); include 'closedb.php'; while ($row = mysql_fetch_array($result)) { $list = ".$row["number"]." ; $list = ".$row["first"]."; $list = ".$row["last"]."; echo( $list );
  2. The following is what I use in my php script for registering people: $mdpwd = md5($password); $sql = mysql_query("INSERT INTO users (username, name, password, email, signup_date) VALUES('$username', '$name', '$mdpwd', '$email', now())") or die (mysql_error()); And this is what I use in my script that checks the login information from the login page: // Conver to simple variables $username = $_POST['username']; $password = $_POST['password']; if((!$username) || (!$password)){ echo "Please enter ALL of the information! <br />"; include 'login_form.html'; exit(); } // Convert password to md5 hash $password = md5($password); // check if the user info validates the db $sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1'"); $login_check = mysql_num_rows($sql); if($login_check > 0){ while($row = mysql_fetch_array($sql)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); }
  3. Do you want to display the rest of the info in that row?
  4. Would love to help, but I constructed mine with php and mysql. I have no idea what cPANEL is.
  5. When your user logs in it gets checked by a file like checkuser.php. Add to that file a mysql query that will update the last_login portion of your table. $sql="UPDATE `users` SET `last_login`= now() WHERE `username` = $_POST['username']" $result=mysql_query($sql) or die(mysql_error()); Of course Corbin and my suggestions will only work if you have a field in your table for last_login. Also where I put `users` you must put in the name of your table. If you place both of our codes in your file that checks the users posted information it will update each users last login as well as delete an inactive user everytime someone logs in.
  6. Do you have a username and password or just a password to access secure data?
  7. TY jesirose. I figured it would surround $rank=1, but I didn't know that putting 1+1 would make it increment while printing a table from a query. I never would of tried it in a million years. I am going to be creating a lot of these types of tables for my site. Is there anywhere here where I can find more info on them. Next Task is to find out how to display winning or losing streak.
  8. What if I used mysql_num_rows to get the number of clans then start with #1 and increment it to the last row?
  9. Done that already. I am trying to display to my users what place each clan is in. How do I place a seven next to the clan in 7th place and so on. Here's how I set up the table so far. I have one of thes queries for each item (clan name, wins, losses, id): <?PHP $sql="SELECT `clan_name`,`wins`,`losses`,`message`,`clan_id`,`link`,`last_battle` FROM `table` ORDER BY `wins` DESC"; $res=mysql_query($sql) or die(mysqll_error()); while ($row = mysql_fetch_array($res)) { $list = "<table width='20%'>"; $list .= "<td>"; $list .= "<td >".$row["clan_name"]."</td>"; $list .= "<td>"; $list .= "</table>"; echo( $list ); } ?>
  10. Would probably be alot easier to just set numbers down the left hand side of my table 1-25 and then list the first 25 clans of my query. On the other hand if a game only has 5 clans at the moment I don't want to have to change the page everytime someone creates a new clan.
  11. I already figured out how to report a loss/win. query the db and display the number of wins/losses for each clan. I list that all on a table for each game. I am trying to set up a way to rank each clan by number of wins. Then display Rank,Clan Name, Wins, Losses, and Clan Id in my table for that game. I don't know what CRON is?
  12. I posted this ? in mysql but no one has really been there for hours.Just wondering if anyone over here would have some insight. I decided to put rank in my game table.For the life of me I cannot figure out how to update and set the rank. I have the table already set up to display the clan name ordered by wins descending. Then everytime a gamer reports the loss I can automatically run the update in my php file when the losses and wins are reported. UPDATE `game` SET `rank`='?' ORDER BY ASC Can't fill in that ?
  13. Without stockmovement.date this query still doesn't work does it?
  14. I decided to put rank in my game table.For the life of me I cannot figure out how to update and set the rank. I have the table already set up to display the clan name ordered by wins descending. Then everytime a gamer reports the loss I can automatically run the update after the losses and wins are set. UPDATE `game` SET `rank`='?' ORDER BY ASC Can't fill in that ?
  15. I want to create a summary table where I can store info to later be displayed. 1)I eventually want to display each clans win or loss streak. Can someone help me on how to configure the table to do this. I already have a table for each game that keeps stats on how many wins or losses each clan has, but I have no idea how to calculate or store a "streak". 2)I also want to have a section of the table that will show the rank of each team which is by most wins in order of descending.Could I use a mysql query to select the data from that table in that order and re-enter it in the new table?
  16. Try posting this in mssql help forum. THey can give you alot more info on joining tables.
  17. thank you for pointing me in the right direction. Definitely going to have to fiddle with it for awhile. I have 5-6 items to be used as table data. So if I wanted to display "clanname"-"wins"-"losses" I would need to set up a new while statement for each set of table data.
  18. What I used was: $clan_name = $list["clan_name"]; $wins = $list["wins"]; $losses = $list["losses"]; echo("$clan_name $wins $losses ");
  19. I don't see your Query that selects the info from the database. Such as: $sql = SELECT `info` FROM `table` $result = mysql_query($sql) or die(mysql_error()); If your pulling the info from the db, gonna need that. THen instead of $rs at the end of array use $result
  20. Here is my code where I pull it up from the db in an array: $sql="SELECT `clan_name`,`wins`,`losses`,`message`,`clan_id`,`link` FROM `bhdsingle` ORDER BY `wins` DESC"; $res=mysql_query($sql) or die(mysqll_error()); while ($list = mysql_fetch_array($res)) { $clan_name = $list["clan_name"]; $wins = $list["wins"]; $losses = $list["losses"]; $message =$list["message"]; $clan_id = $list["clan_id"]; $link = $list["link"]; }
  21. could be this at the end: print(" </tr> </table> "); }} You have print(" followed by html tags then "); more likely its the 2} that you don't seem to need at the end
  22. You didn't place SESSION_START(); at the start of your php.
  23. How would I even go about this.I figured out the query and how to list my array. I would like to create a table visible to users that displays my array. I would also like it to automatically set the number of rows by the number of clan names in that database.
×
×
  • 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.