Skip to content

Instantly share code, notes, and snippets.

@acoustep
Created January 16, 2013 14:07
Show Gist options
  • Save acoustep/4547330 to your computer and use it in GitHub Desktop.
Save acoustep/4547330 to your computer and use it in GitHub Desktop.
<snippet>
<content><![CDATA[
if(\$stmt = \$mysqli->prepare(${3:"${4}"}))
{
${5:\$stmt->bind_param('${6:i}', ${7});}
\$stmt->execute();
\$stmt->bind_result(${8});
while(\$stmt->fetch())
{
${9}
}
}
else
{
if (\$mysqli->error) {
try {
throw new Exception("MySQL error \$mysqli->error <br> Query:<br> \$query", \$msqli->errno);
} catch(Exception \$e ) {
echo "Error No: ".\$e->getCode(). " - ". \$e->getMessage() . "<br >";
echo nl2br(\$e->getTraceAsString());
}
}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>sqlm</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment