Need help debugging, ...please
Posted: Mon Jan 30, 2006 9:55 am
Jcart | Please use
The strange thing is that my efforts to debug were unsuccessful. I tried the following change:
but it doesn't give a more descriptive error - it stays the same.
if I write:
it totally dies and displays a blank page when calling the function user_register() from h_register.php.
The other thing I can't figure out is why after adding:
it doesn't display it either.
if it's necessary I can post more code or even everything.
thank you,
pesho
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi all,
I'm almost hopeless that somebody will spot the error, but maybe this forum will help.
The error is: "[b]ERROR - database error[/b]" and it's coming from the following fragment in [b]h_register_funcs.inc[/b]:Code: Select all
else {
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$password = md5($_POST['password1']);
$user_ip = $_SERVER['REMOTE_ADDR'];
// Create a new hash to insert into the db and the confirmation email
$hash = md5($email.$supersecret_hash_padding);
$query = "INSERT INTO user (user_name, first_name, last_name, password, email, remote_addr, confirm_hash, is_confirmed, date_created)
VALUES ('$user_name', '$first_name', '$last_name', '$password', '$email', '$user_ip', '$hash', 0, NOW())";
$result = mysqli_query($dbh, $query);
if (!$result) {
[b]$feedback = 'ERROR - Database error';[/b]
return $feedback;
}Code: Select all
$feedback = 'ERROR - Database error'.mysqli_error($dbh);if I write:
Code: Select all
$result = mysqli_query($dbh, $query) or die(mysqli_error($dbh));The other thing I can't figure out is why after adding:
Code: Select all
echo $query;if it's necessary I can post more code or even everything.
thank you,
pesho
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]