Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. pollock77

    Checking Login Status

    Okay, for this page, I need to check if the user is logged into my site or not. If the person is, $_SESSION['username'] will return a true value. If the value is true, I want to print the content of the page. If it returns false, I want to print an error message like "You are not currently...
  2. pollock77

    Problem with Recalling Recent Messages

    Thanks, it's now working. :)
  3. pollock77

    Problem with Recalling Recent Messages

    I get an error now. 9 $time = date("U"); 10 $display = $time-900; 11 $res = mysql_query("SELECT COUNT (*) as cnt FROM messages WHERE date >= $display"); 12 $info=mysql_fetch_assoc($res); 13 $entries = $info['cnt']; Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result...
  4. pollock77

    Problem with Recalling Recent Messages

    Okay, the following code is for a type of chat room in which, either messages that are less than 15 minutes old, or the most recent 25 messages will be printed. However, all that is being printed is the HTML tag and the Backround tag, which are not in the PHP coding. And, yes, I do have a...
  5. pollock77

    PHP/MySQL Syntax Issues

    I have recurring issues with incorporating SQL syntax with PHP. This is what I have, followed by the error I'm getting. elseif ($_GET[action] == 'edit' & $_POST[username] != '') { $query="UPDATE users SET username='$_POST[username]', PASSWORD='$_POST[PASSWORD]', handle='$_POST[handle]'...
  6. pollock77

    Syntax Question

    Oh, thank you very much, it worked :D
  7. pollock77

    Syntax Question

    I did that and got this error:
  8. pollock77

    Syntax Question

    Yes, that helps, but now I'm ending up with an SQL error in syntax.
  9. pollock77

    Syntax Question

    I'm not sure why this code isn't working. $data="('$_POST[username]', '$_POST[PASSWORD]', '$_POST[handle]', '$_POST[rank]', '$_POST[group]', '$_POST[gender]', '$_POST[av]')" $result3 = mysql_query("INSERT INTO users $data") or die(mysql_error()); echo "Account successfully updated...
  10. pollock77

    Branching

    I'm sort of confused. I'm a beginning programmer, and I first learned PERL. I'm wondering if PHP has branching for if, elsif, elsif, elsif, else type of thing where there are mulitple situations, and if so what is the syntax for it?
  11. pollock77

    mysql_num_rows();

    Oh thanks, I guess my table setup failed :)
  12. pollock77

    mysql_num_rows();

    I can't get this function to work. A sample code: <? $link = mysql_connect("localhost", "users", "users"); mysql_select_db("users", $link); $result = mysql_query("SELECT * FROM user", $link); $num_rows = mysql_num_rows($result); echo "$num_rows Rows\n"; ?> And I'm getting the following...
  13. pollock77

    Fetching Data File

    Not what I meant, but that works just as well, I think. Like, if I wanted to print the number nine, I'd just use $rec[9] correct?
  14. pollock77

    Fetching Data File

    I guess I'm not describing it very well. I want ($username,$rank,$handle,$password,$group,$word) to be in a separate file, so that if I need to add a new variable, ex: ($username,$rank,$handle,$password,$group,$word,$NEW), then I wouldn't want to go through every program and add ,$NEW to every...
  15. pollock77

    Fetching Data File

    Any help?
  16. pollock77

    Fetching Data File

    In this case, $group will be used to determine whether or not a user has access to a given page.
  17. pollock77

    Fetching Data File

    Oh, and it's an account file.
  18. pollock77

    Fetching Data File

    pollock77|Admin|John Smith|abc123|admin|Programmer
  19. pollock77

    Fetching Data File

    I see why you would be confused, but that's not what I meant. I want one file to be ($username,$rank,$handle,$password,$group,$word) Then, I want to call it up in this program, something like open(ACCOUNT, $data_file) || die("Could not open file!"); @raw_data=<ACCOUNT>; close(ACCOUNT)...
  20. pollock77

    Fetching Data File

    open(ACCOUNT, $data_file) || die("Could not open file!"); @raw_data=<ACCOUNT>; close(ACCOUNT); foreach $account (@raw_data){ chop($account); ($username,$rank,$handle,$password,$group,$word)=split(/\|/,$account); I want the ($username,$rank,$handle,$password,$group,$word) in a separate...

Part and Inventory Search

Back
Top