Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: please help me

  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy please help me

    i have two scripts that corrospond to each other:

    http://codepad.org/3scFzIdo

    it connects to this:

    http://codepad.org/mLxMdQZ0

    when I try to click on the Submit button, the browser returns " Regular User Access restored to , owner of account '''' "
    im not even sure it's drawing data from my database. What did I do wrong, can anyone help?

  • #2
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    In short, run an echo mysql_error(); to see if you're getting any errors
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #3
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    You forgot to echo $id here:
    Code:
    <option value="<?php echo $id ?>"<?php if($i <= 1) { echo ' selected'; } ?>><?php echo $last . ', ' . $first; ?></option>
    So none of that select box had values. By the way, "selected" is a horrible name for a select box since it's actually an html attribute.

    And no, it's not pulling anything from the db because the query, then, would be
    Code:
    SELECT * FROM accounts WHERE id = ''
    Assuming there are no empty IDs, nothing was pulled.

    Here's an extra tip. If you've written your code correctly, you should never be in a position to say "I don't know what my code did to the database." In the real world, that can get you fired... or worse.

    The database functions provide return values. Test them. That's why they are there: so you know what the code is doing to your data. I'm not going to bother describing the values because that's what the manual pages are for. Just type php.net/ followed by the function name in your address bar. There are usually a host of examples showing how to use them and how to handle return values.
    Are you a Help Vampire?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •