View Full Version : please help me

01-09-2010, 12:34 PM
i have two scripts that corrospond to each other:


it connects to this:


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?

01-09-2010, 02:53 PM
In short, run an echo mysql_error(); to see if you're getting any errors

01-10-2010, 01:10 AM
You forgot to echo $id here:

<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

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.