MyBB Community Forums

Full Version: Need Help With Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Solved
Why are you running three separate queries for the same query? In addition, you keep setting $row to "mysql_fetch_array($result);" and you never actually use it anywhere in your code. You also seem to close and open the PHP tags spontaneously where I see no reason to, and lastly, if you are using this on a production server, you should sanitize inputs.

Anyway, your problem lies with your echo statements, specifically the ones that are similar to this:


    echo "<th><input type="text" name="email" value=" . $row3['email']; . "/></th>";

You're using the double quote to define the contents of the echo statement, yet you use double quotes for your string. Either escape the double quotes in your string or resort to single quotes. In addition, " . $row3['email']; . " this is wrong, you don't place a semicolon there, it's not the end of the statement. There are a few other things you can take advantage of for your code, but I'm sure you'll learn about them soon as you strengthen your PHP knowledge.

All the best,
Imad Jomaa.
Why are you using the MySQL 4.x driver? use the mysqli_* functions (or object if you're up to it) unless being a caveman is your thing.

Imad pointed out the errors in your script.
Thanks, Ill test it out. I know, and when this code is out of being developed I'll clean it up. Only a couple people are going to have access to the production code anyway. I'll try the code out. Thanks!