Search:

Type: Posts; User: Anne Arbor; Keyword(s):

Page 1 of 3 1 2 3

Search: Search took 0.00 seconds.

  1. traq, I might even understand how to do this. ...

    traq, I might even understand how to do this. :-)

    Does any of this shed any light on the problem of temps data sometimes being assigned to the wrong user? that is, to the non-existent user...
  2. Sure, my database looks like this: 1st table...

    Sure, my database looks like this:

    1st table - users:



    Field Type Null Default Auto_increment

    user_id smallint(5) No yes auto_increment...
  3. traq, thank you for using the term 'foreign key'!...

    traq, thank you for using the term 'foreign key'! As mentioned to Daniel, it seemed to me that I needed to be using foreign keys way back when I first tried to write this program, but others shot...
  4. Daniel, thank you very much for your reply and...

    Daniel, thank you very much for your reply and all the information, especially about sessions.

    My initial post seemed strange to you, I think, because my program is actually written in a rather...
  5. What is a good way to make one table 'interact' with another?

    My small PHP program has two tables, each with 4-5 columns. So it's about as simple a database as one could have.

    There is a users table and a temps (temperatures) table. The idea is that a...
  6. Traq, I've been working at this for several hours...

    Traq, I've been working at this for several hours now and should probably let it go for a while. I'm grateful to you for all your help and, although the problem is not yet solved, I have been...
  7. I've modified the code to say this: ...

    I've modified the code to say this:



    function checkLoggedIn(){
    return !empty($_SESSION["user_id"]);
    }

    if(checkLoggedIn() ) {
    echo '<p>Still logged in, and that is important.</p>';
  8. Something good might have happened, although I'm...

    Something good might have happened, although I'm not entirely sure why.

    For the moment, I've commented out all the 'new' code. I went back to my 'logged_in' page, grabbed some of that code...
  9. Oops (accidental post)

    Oops (accidental post)
  10. I tried adding the suggested code, or something...

    I tried adding the suggested code, or something like it. Here is the code I added:



    session_start();

    function checkLoggedIn(){
    return !empty($_SESSION["user_id"] };
    ...
  11. I haven't tried the new function yet because I...

    I haven't tried the new function yet because I need to set aside a block of time for that, and the opportunity is eluding me so far today.

    Last night, after re-reading traq's comments and...
  12. Traq, I may owe you a pretty big apology. I was...

    Traq, I may owe you a pretty big apology. I was trying *not* to post code that wasn't strictly relevant, so as not to clutter things up. The risk is, of course, that one leaves something essential...
  13. Traq, that looks very cool. My understanding of...

    Traq, that looks very cool. My understanding of PHP is so threadbare that it will take me a while to try it, but I really look forward to doing so.

    I hope to try this later tonight or...
  14. Traq, thank you for your help. Looking at the...

    Traq, thank you for your help. Looking at the actual code on the server, the session function is written correctly, i.e., session_start();

    After I posted the code here, I went back over it and...
  15. Traq, this is a program that I cobbled together...

    Traq, this is a program that I cobbled together several years ago, relying on a fairly popular "Write your own program in PHP and MySQL" textbook.
    It seemed like a miracle to me that it worked at...
  16. And here, fwiw, is the actual script for entering...

    And here, fwiw, is the actual script for entering the data. A registered user arrives at this page after logging in.



    /* This script adds a log entry to the database. */

    if...
  17. Traq, you seem to be suggesting that the problem...

    Traq, you seem to be suggesting that the problem might lie in the log-in code, so I'll supply that here:



    <?php // Ullman Script 11.4 (DWS) - login.php

    ob_start(); // Start output...
  18. Traq, thank you very much for your reply. The...

    Traq, thank you very much for your reply. The only change from my actual code is that I am using "temp" here and the actual code uses a different word. Otherwise, everything is identical.
    ...
  19. James, just so you know, my actual program does...

    James, just so you know, my actual program does not work with temperatures. I've been trying to preserve a bit of privacy about the real topic. The temperature analogy is very close, however, and...
  20. Thank you, James. I was hoping it was a database...

    Thank you, James. I was hoping it was a database problem. But no such luck. ;-)

    Here's what I have, with all its faults:



    <?php // add_entry.php

    ob_start();
    require_once...
  21. Strange error re user_id when adding entries to database

    I have a simple PHP program and a small MySQL database. When I add a new entry to the database, using a form, I often get the following error: "Undefined index: user_id"

    My personal user id...
  22. Replies
    2
    Views
    845

    Resolved Hey, I edited my code, as described above, and it...

    Hey, I edited my code, as described above, and it worked! Not only took the backslashes out of my new entry, but deleted them from every previous entry made during the past two years.

    Okay, do...
  23. Replies
    2
    Views
    845

    Resolved Getting rid of backslashes

    I have a very simple program that, in its output, inserts a backslash before every apostrophe and before every quotation mark (whether single or double). For example: He will call you after he/'s...
  24. Resolved James, I've made the change you suggested in...

    James,

    I've made the change you suggested in the query, and it seems to have done the trick. (I didn't change anything else because I was concerned about 'unintended consequences.')

    While...
  25. Resolved No, I haven't tried that yet. It was all I...

    No, I haven't tried that yet. It was all I could do today to open my cPanel and then open PHPMyAdmin, and then do some fiddling with the database -- really, all these kinds of things make me break...
Results 1 to 25 of 57
Page 1 of 3 1 2 3