Jump to content

shaunrigby

Members
  • Posts

    196
  • Joined

  • Last visited

    Never

Everything posted by shaunrigby

  1. <?php echo $row['columnName']' ?> Where columnName is the name of the column you want to print from your DB
  2. Dude, we are swamping the kid with code, alohat, try my code, then post back th me the error message you are receiving, then do the same with madtechcie's code
  3. what error message does my script return?
  4. remove: that should solve your problem
  5. post the page you are setting the session vars and post the page thats using the session vars
  6. Code revamp: <?php $time=time(); $timeout=time()+(60*60); #now+1hour ` mysql_query("UPDATE `username` SET `timestamp` = '" . $time . "' WHERE `memberId` = '" . $id . "' LIMIT 1") or die("Update Query 1: " . mysql_error()); $query = mysql_query("SELECT * FROM `surv_member` WHERE `online`= '1' AND `timestamp` >= '" . $timeout . '") or die("SELECT Stament: " . mysql_error()); while($row=mysql_fetch_array($query)){ mysql_query("UPDATE `username` SET `online` = '0' WHERE `memberId` = '" . $row['id'] . "' LIMIT 1") or die("Update Query 2: " . mysql_error()); print $row['online']; } mysql_close(); ?>
  7. Also, please read: http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  8. try taking out the exit; afterwards
  9. Change : $conn = db_connect(); if (!$conn) return "Could not connect to database server - please try later."; // check if username is unique $user_name = $_POST['user_name']; $result = mysql_query("select * from members_info where user_name='$user_name'"); if (!$result) return "Could not execute query". mysql_error(); if (mysql_num_rows($result)>0) return "<p class=\"genmed\">That username is taken - go back and choose another one.</p>"; To: $conn = mysql_connect($host,$username,$password) or die("Could not connect to database server - please try later." . mysql_error());//Remove . mysql_error() after you have finished developing your code mysql_select_db($dbname) or die(mysql_error()); // check if username is unique // $user_name = $_POST['user_name'];//Why you setting this? you are obtaining it VIA your function, $query = mysql_query("SELECT * FROM `members_info` WHERE `user_name` = '" . $user_name . "'") or die(mysql_error()); $result = mysql_num_rows($query); if ($result > 0 ) { return true; } else { return false; }
  10. Are you passing the ID via URL? or via a form? URL = $_GET Form = form method $_GET/$_POST also, try $_GET[i'd']
  11. Lets make it easier for ourselves, Trium, please post the function wrapped in code tags
  12. did that appear on your screen? please wrap [ code][ /code] tags around your code to make it easier for us to understand, and also plus post the function to work out why it is returning NULL
  13. in your while statement put print "UPDATE `username` SET online='0' WHERE memberId='$row[id]' LIMIT 1"; and check that against your database Google "MYSQL UPDATE STATEMENT" (minus the " 's) for what Syntax to use for UPDATE statements
  14. that is if s/he uses return true; and in what context (1/0, true/false)
  15. Try using the switch case that i posted to you in another thread, if you CBA then change your elseif to else if { //code }
  16. if($reg_result === TRUE){ //INSERT PROCESSING HERE } else { //UL DUMBA$$ SOMEBODY HAS YOUR PREFERRED NAME }
  17. add mysql_select_db($database); Underneath your MySQL_Connect function
  18. Lookup "php sessions" (minus quotes) on Google to find out how to add variables to a session, and use it to determine if the person logged in is allowed to edit it using a boolean true/false
  19. Right now? Windoze EXPEE, because I find Ubuntu extremely complicated, and although I have WAMP I am not exposed directly to the internet
×
×
  • 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.