Jump to content

Greaser9780

Members
  • Posts

    326
  • Joined

  • Last visited

    Never

Everything posted by Greaser9780

  1. I have a file called crontimer.php I want my CRON to run. What command do I need to use.
  2. I can now echo them. When I try to subtract my time from expiry time it just displays 0.
  3. I used a query to call 2 timestamp fields from a table. I can't echo either of them. Do I need to convert back to some time format?
  4. $time=mysql_query("UPDATE time SET time = now(), exptime = NOW()+ INTERVAL $hour HOUR, $minute MINUTE ");
  5. Shouldn't it be time() + (12 * 60 * 60) otherwise 0*12*0*0 = 0
  6. When I created mine I had a smimilar prob. Where you have localhost I had to put mysql. Don't know about yours though. It is odd that you don't need a pass though.
  7. I am trying to create a script based on time and expiry time. I want to set time limit for 12 hours. I thought set time=now() and exptime = now()+43200<----# of seconds. But it only added 4 hours and 12 minutes. Where did I go wrong?
  8. I want to select name from my table I am trying to get a result that has the lowest activate # and the lowest teamid Tried this but I don't know how to word it. $sql1 =mysql_query("SELECT name FROM `teams` ORDER BY activate,teamid ASC LIMIT 1");
  9. I am tryin to develop a script in which users will make a choice from a list and then it will get inserted as choice 1,2, etc. There is a set order in which these users must go by. (in order of registration id) I'm trying to figure out how to make the script tell if it is a users turn to choose. I am thinking about adding a field in my users table with the type enum value is = to total number of choices. What could I use to set the enum to the next value. I was thinking something like: Update `users` INCREMENT `order` Not sure if that is a valid mysql query though. Any thoughts?
  10. Happy to hear the answer. I tried about 10 differentways to incorporate it into the table or td but to no avail.As usual ty for the expert advice.
  11. Thanks for the input. Why does the $rank++ go outside of the $list? It works that way but why?
  12. This is my code: while($r=mysql_fetch_array($sql1)) { $rank=1; $list = "<table>"; $list .="<td width='61'>$rank </td>; $list .="<td width='150' align='left'>".$r['name']."</TD>"; $list .="<td width='150' align='left'>".$r['1pick']."</td>"; $list .="<td width='50' align='left'>".$r['1pos']."</td>"; $list .="</table>"; echo $list; } How can I incorporate $rank++ so that my rank continues to 2 on the 2nd listing?
  13. Changed variable name and now it works. That was really weird.
  14. INSERT INTO `players` (`name`,`pos`) VALUES ('Joe','') Odd, it's like it's either not getting it from the form or not recognizing the variable.
  15. Here's the form: <form action="addplayer.php" method="post"> Player Name:<input type="text" name="name"><br> Position:<input type="text" name="pos"><br> <button type="submit">Submit</button> </form> Here's the script: <?php include("db.php"); array_pop($_POST); if ( get_magic_quotes_gpc() ) { $_POST= array_map('stripslashes', $_POST); } $name = mysql_real_escape_string(trim($_POST['name'])); $pos = mysql_real_escape_string(trim($_POST['pos'])); $sql = mysql_query("INSERT INTO `players` (`name`,`pos`) VALUES ('$name','$pos')") or die(mysql_error()); $playerid = mysql_insert_id(); include("addplayerform.html"); ?> The name will get entered but the position "pos" will not go into the table. I even set default value for what my $_POST['pos'] is and it still won't go in. Field is set to varchar 20 and that's it.
  16. Where you said how could sessions be destroyed from this page, I saw no place where they should be. THe problem might lie in the page after that. If you don't have session_start() at the top on that one it will kill it.
  17. If you need to have name and whatever else put in, there needs to be a field for it in your table. Then you also have to prompt them for it in your registration form. Then after everything checks out you will need to input everything in your db table.
  18. The way you had it meant you were trying to call the field from the table during the where section.
  19. I can't find anywhere where they actually post Student_1_name to the script I checked your form too. IDK maybe I'm missing something.
  20. $query2="SELECT * FROM factoryinfo WHERE factoryid = '$factoryid' ORDER BY rating DESC";
  21. Thanks for the heads up. That'll come in handy.
  22. can you post the section where you define the variables i.e. $blah=$_POST['blah']
×
×
  • 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.