Solved

sqlsrv_query considered prepared statement

Posted on 2014-12-05
2
121 Views
Last Modified: 2014-12-06
Simple question I am sure.  

Is this considered a prepared statement in SQL Server in PHP?   Is this method the safest way when following the ideas of prepared statements for PHP in SQL Server?

$sql = "SELECT * FROM table.toys WHERE Id= ? or Id= ?";
$params = array(3,5);//relative to the two ? above

$stmt = sqlsrv_query( $conn, $sql, $params);

Open in new window

0
Comment
Question by:Zipbang
2 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40484171
I've never used it that way but apparently it is.  http://php.net/manual/en/function.sqlsrv-query.php
0
 

Author Closing Comment

by:Zipbang
ID: 40484744
thank you
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now