Jump to content

ebotelho

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ebotelho's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I don't think that is possible due to the fact that there are many games and the players may be confirmed in more than one game at a time.
  2. Hello. I have been developing my website and I need to create a link that moves one information from one table to the other if a certain condition is found. I have already explained what my website is about in another post, but since the focus has now changed, I've proceeded into creating a new topic. The thing is, I have two databases: one for confirmed, one for not confirmed. I want to make a link, or a button, that upon its pressing would delete an user from one table and insert the same user to the other. My idea is exactly the same as the "Topic Solved" button from phpfreaks. Is it possible to be done in PHP? Thanks in advance.
  3. Thank you so much for your help. Indeed it was much more organized and clean. You guys make a nice team, because your information complemented each other perfectly! I worked with the two new tables, conf_players and nconf_players. Fields: id_conf_players, id_jogos, and id_players and used exactly the same query Psycho mentioned above. EDIT: as to the not confirmed players who confirm, these players need to be inserted in the confirmed players table. Is there a way to replace the information between two different tables? Or is it mandatory to perform an insert and delete? In this case, is it possible to do so in the same query?
  4. Hello everyone. (if you want a quick description of the problem skip this part) I'm currently developing a website that manages our soccer games. It has a userlist and a gamelist stored in a mysql table. The userlist table is called 'usuários' and the game table is called 'jogos'. This table jogos has the following fields: id, data (day), conf (confirmed players), nconf (not confirmed), criado (day the game was created). What I wanna do is creating a page where is possible to create a game in a certain day, then list all the users registered so the admin can pick who's gonna play. After that, everyone that is confirmed should be put on the conf part of the table, while those who didn't confirm should be shown on the nconf part of the table. (and look here) However, this is giving me some trouble right now. I do not know how can I list every player not yet confirmed on a column of a table. My code is given below <?php require_once("configs.php"); session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Criar Pelada</title> <script language="javascript" src="calendar.js"></script> </head> <body> <div id="registro"> <form action="" method="post" name="form1"> <input type="hidden" name="criarpelada" /> <select name="dia"> <?php //seletor de dias $i; for ($i = 1; $i<32; $i++) { echo ("<option value=".$i.">".$i."</option>"); } ?> </select> <select name="mes"> <?php //seletor de mês $m; for ($m = 1; $m<13; $m++) { echo ("<option value=".$m.">".$m."</option>"); } ?> </select> <select name="ano"> <?php //seletor de ano $a; for ($a = 12; $a<15; $a++) { echo ("<option value=".$a.">".$a."</option>"); } ?> </select> <?php $buscar = "SELECT * FROM usuarios"; $listar = $con->query($buscar); if ($listar->num_rows > 0) { echo ("<p>Quem está convidado?</p><br>"); while ($encontrado = $listar->fetch_object()) { echo("<input type=\"checkbox\" name=\"confirm\"> ".$encontrado->first." ".$encontrado->last."<br>"); //listar usuário } } //adicionar usuários à lista de nao confirmados if ($_POST['confirm']) { } $dd = $_POST['dia']; $mm = $_POST['mes']; $aa = $_POST['ano']; $data = strtotime($dd."-".$mm."-".$aa); //test //echo ($data); //$criar = $con->query("INSERT INTO jogos (data,conf,nconf,criado) VALUES ('$data','$conf','$nconf',now())"); //echo("<p>Pelada criada no dia ".$dd."/".$mm."".$aa."</p><br> // <p>Você está automaticamente confirmado</p>"); ?> <input type="submit" name="enviar"/> </form> </div> </body> </html> ps: I know there are a lot of php calls, and I did so because the processing happens in the same page.
×
×
  • 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.