<p>The question is a fairly open one. I've been using Stored Procs with MS SQLServer for some time with classic ASP and ASP.net and love them, lots.</p>

<p>I have a small hobby project I'm working on and for various reasons have gone the LAMP route. Any hints/tricks/traps or good starting points to get into using stored procedures with MySQL and PHP5? My version of MySQL supports Stored Procedures.</p>

You'll need to use
MySQLI
(MySQL Improved Extension) to call stored procedures. Here's how you would call an
SP
:
```
```
$mysqli = new MySQLI(user,pass,db);

$result = $mysqli->query("CALL sp_mysp()");
```
```
When using SPs you'll need close first resultset or you'll receive an error. Here's some more information :
http://blog.rvdavid.net/using-stored-procedures-mysqli-in-php-5/
(broken link)
Alternatively, you can use
Prepared Statements
, which I find very straight-forward:
```
```
$stmt = $mysqli->prepare("SELECT Phone FROM MyTable WHERE Name=?");

  $stmt->bind_param("s", $myName);

  $stmt->execute();
```
```
MySQLI Documentation:
http://no.php.net/manual/en/book.mysqli.php