how to get the result of a mysql prepared query

AdamR

I am using the php prepared statement to query a table to see if the given value is in a column. However i cannot seem to get a result out of the prepared query. I can get whether or not the query happened successfully but not the results from that query.

$write = $DB_Connection->prepare("SELECT * from Table where Column = ?");

$result = $write->bind_param('s', $Value);

I have tried

$write->fetch();
mysqli_stmt_fetch($write);

but these do not give me useful results. I cannot use get->results as its not mysqlnd

Any help would be appreciated.

Sirko

You still have to execute the query after preparing and binding:

// execute statement
$resultset = $write->execute();

// grab data, eg., like this
$result = $resultset->fetch_all();

Besides you should check for errors somewhere as well.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Get result from prepared query in a MySQL Trigger?

From Dev

MySQL query prepared statement not returning any result

From Dev

MySQL Join Query { How to get following Result }

From Dev

How to write a query to get result in mysql

From Dev

how to get mysql query result in jsp page?

From Dev

Prepared default query with result to prepared query with bindings

From Dev

How to query to get this result?

From Dev

MySQL get result of stmt result for dynamic query

From Dev

NodeJS - how can get mysql result with executed query?

From Dev

how do i get last result in group by MySQL query (not the first)

From Dev

JSP,mysql - How to get and store variable from a fresh query result

From Dev

Change standand MySQL query to 'prepared' MySQL query

From Dev

Get ActiveRecord MySQL Query result as a hash, not array

From Dev

Mysql query get result by month and year

From Dev

Get place in result on query with join MYSQL

From Dev

MySQL query to get Records in Result set

From Dev

get highest value with query result in mysql

From Dev

Get mysql table name from query result

From Dev

MySql: how to get the desired result

From Dev

Get prepared statements list in mysql

From Dev

mysqli prepared statement get_result()?

From Dev

Prepared statements without using get_result()

From Dev

How to write prepared statements for this query?

From Dev

How to limit MySQL query result to specific results?

From Dev

How to store MySQL query result in a string

From Dev

How to remove +-----+ from mysql query result

From Dev

How to limit MySQL query result to specific results?

From Dev

mysql php: how to properly save a query result

From Dev

how to store the query result into a variable in mysql

Related Related

HotTag

Archive