Arek Posted November 26, 2009 Posted November 26, 2009 $stmt = $mysqli->prepare('SELECT user_name from `user_details` where user_email = ?'); $stmt->bind_param('s', $var); $stmt->execute() or $this->myerror[] = $stmt->error; Any idea why this wont work, and wont give a error? Quote
Toppy Posted December 2, 2009 Posted December 2, 2009 The code is fine. It'll work if you're connected to the DB, SQL fields are correct and of course $var contains an email address. Try grabbing the results after the binding execute: $stmt = $mysqli->prepare('SELECT user_name from `user_details` where user_email = ?'); $stmt->bind_param('s', $var); $stmt->execute() or $this->myerror[] = $stmt->error; $stmt->bind_result($user_name); while ($stmt->fetch()) { printf("Username is: %s \n", $user_name); } Quote
Arek Posted December 3, 2009 Author Posted December 3, 2009 Hey Hey, the sql was fine but there was a error, i dident user $stmt->store_result to save it. Dont see how this helps when programming but it fixed it anyway :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.