Created
January 16, 2013 14:07
-
-
Save acoustep/4547330 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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