note 54658 added to function.mssql-get-last-message

From: Date: Mon, 11 Jul 2005 21:16:47 +0000
Subject: note 54658 added to function.mssql-get-last-message
Groups: php.notes 
Request: Send a blank email to php-notes+get-91782@lists.php.net to get a copy of this message
I'm trying to build a demo of SQL Injection (SI) to discuss with my students. The idea is discuss how to avoid SI using some secure code techiques. I'm using PHP 4.3.11 and MSSQL 80 on a windows XP box. Sometimes a multiline query is submitted to the server, something like this: -------------------- use sales; select name from users; drop table xxx; -------------------- Note the query above has in fact three queries, each one producing a message but the function mssql_get_last_message() aparently doesn't return all of them to the user. Capturing the packets during connection I can see all messages returning from the server, like this: ----------- (1) Changed database context to 'sales' (2) <result set here> (3) Cannot drop the table 'xxx', because it does not exist in the system catalog. ---------------- But only the first message is returned from mssql_get_last_message(). Can anyone help to explain this ? Thanks. ---- Manual Page -- http://www.php.net/manual/en/function.mssql-get-last-message.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54658 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54658&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54658&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54658&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54658&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54658&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54658&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54658&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91782) next »