php - Catchable fatal error: Object of class mysqli_result could not be converted to string in registration -
i have created registration form , using following code in order display loginid created when form completed. following code results in "catchable fatal error: object of class mysqli_result not converted string in". i'm not sure why doing this.
$result = mysqli_query($con, "select loginid user name='$namefromform' , password='$pwd'"); echo $result;
i have tried using
$sql = mysqli_query($con, "select loginid user name='$namefromform' , password='$pwd' '$login'"); $result = mysqli_query($con, $sql); echo $result->fetch_object()->$login;
to fix problem suggested in regards above error although results in errors "warning: mysqli_query() [function.mysqli-query]: empty query in"
and
"fatal error: call member function fetch_object() on non-object in "
in regards 2 new lines. i'm not sure i'm going wrong this, data trying recieve auto increment primary key if has impact. i'm not concerned security of doesn't need secure, work.
thanks
try this,
$result = mysqli_query($con, "select loginid login user name='$namefromform' , password='$pwd'"); $row = mysqli_fetch_array($result); echo $row['login'];
Comments
Post a Comment