Jump to content

MySQLi prepared fetch stmt array


Recommended Posts

Hello, i'm wondering how to make same method at MySQLi prepared what was in MySQL (code below).

$query = "SELECT * FROM data";$result = mysql_query($query);while ($row = mysql_fetch_array($result)) {echo $row['MyData'];}

I've tried this so far.

$query_gls = "<select query>"; //You wont need to know thisif ($stmt = $con->prepare($query_gls)) {$stmt->bind_param("s", <My post variable>); //You wont need to know the post variable either.$stmt->execute();if($stmt->fetch()) {/* Im lost at this part */} else {die("MySQLi Failure");}}
Link to comment
Share on other sites

Aaah i got it now, thx, but is there any other pasting method than printf()? Got this solved aswell, thx for help.

Edited by Mudsaf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...