|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-09 08:53 UTC] mydwin at msn dot com
[2004-08-09 18:50 UTC] pollita@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 20:00:01 2025 UTC |
Description: ------------ -= The SQL is =- CREATE TABLE `test` ( `id` int(10) unsigned NOT NULL auto_increment, `Name` varchar(50) collate utf8_bin NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=5 ; INSERT INTO `test` VALUES (1, 0x61); INSERT INTO `test` VALUES (2, 0x62); INSERT INTO `test` VALUES (3, 0x63); INSERT INTO `test` VALUES (4, 0x64); -= the test.php code is =- <pre><?php $iFromID = $_POST["FromID"]|0; $iToID = $_POST["ToID"]|0; $DB = new mysqli( "localhost", "root", "", "testDB" ); if( $Temp_From=$DB->query( "SELECT * FROM test WHERE id=$iFromID" )->fetch_assoc() && $Temp_To=$DB->query( "SELECT * FROM test WHERE id=$iToID" )->fetch_object() ) { print_r($Temp_From); echo "\n\n\n"; print_r($Temp_To); } ?> <form method="post" action="test.php"> <input name="FromID" value="1" /> <input name="ToID" value="2" /> <input type="submit" value="Submit" /> <input type="reset" value="Reset" /> </form> </pre> Expected result: ---------------- Array ( [id] => 1 [Name] => a ) stdClass Object ( [id] => 2 [Name] => b ) Actual result: -------------- 1 stdClass Object ( [id] => 2 [Name] => b )