I have spent some time to create the following test php running on
quercus. You just need to copy and paste into test.php and run it to
recreate the error easily -
<?
/*
** Connect to database:
*/
// Connect to the database (host, username, password)
$con = mysqli_connect('localhost','admin','jiql') or die('Could not
connect to the server!');
// Select a database:
mysqli_select_db($con, 'drupal') or die('Could not select a
database.');
//mysql_select_db('drupal',$con) or die('Could not select a
database.');
$SQL = "DROP TABLE `sessions`;";
//$result = @mysql_query($SQL, $con);
$result = @mysqli_query($con, $SQL);
$SQL = "DROP TABLE `users`;";
//$result = @mysql_query($SQL, $con);
$result = @mysqli_query($con, $SQL);
$SQL = "CREATE TABLE `sessions` ( `uid` int(10) unsigned NOT NULL,
`sid`
varchar(64) NOT NULL DEFAULT '', `hostname` varchar(128) NOT NULL
DEFAULT '', `timestamp` int(11) NOT NULL DEFAULT '0', `cache`
int(11) NOT NULL DEFAULT '0', `session` longtext, PRIMARY KEY
(`sid`) );";
//$result = mysql_query($SQL, $con) or die('A error occured: ' .
mysql_error());
$result = mysqli_query($con, $SQL) or die('A error occured: ' .
mysql_error());
//$SQL = "INSERT INTO `actions` VALUES
('comment_unpublish_action','comment','comment_unpublish_action','','Unpublish
comment');";
//$result = mysqli_query($con, $SQL) or die('A error occured: ' .
mysql_error());
//$result = mysql_query($SQL, $con) or die('A error occured: ' .
mysql_error());
$SQL = "CREATE TABLE `users` ( `uid` int(10) unsigned NOT NULL,
`name` varchar(60) NOT NULL DEFAULT '', `pass` varchar(32) NOT NULL
DEFAULT '', `mail` varchar(64) DEFAULT '', `mode` int(4) NOT NULL
DEFAULT '0', `sort` int(4) DEFAULT '0', `threshold` int(4) DEFAULT
'0', `theme` varchar(255) NOT NULL DEFAULT '', `signature`
varchar(255) NOT NULL DEFAULT '', `signature_format` smallint(6) NOT
NULL DEFAULT '0', `created` int(11) NOT NULL DEFAULT '0', `access`
int(11) NOT NULL DEFAULT '0', `login` int(11) NOT NULL DEFAULT
'0', `status` int(4) NOT NULL DEFAULT '0', `timezone` varchar(8)
DEFAULT NULL, `language` varchar(12) NOT NULL DEFAULT '',
`picture` varchar(255) NOT NULL DEFAULT '', `init` varchar(64)
DEFAULT '', `data` longtext, PRIMARY KEY (`uid`), UNIQUE KEY
`name` (`name`) );";
//$result = mysql_query($SQL, $con) or die('A error occured: ' .
mysql_error());
$result = mysqli_query($con, $SQL) or die('A error occured: ' .
mysql_error());
$SQL = "INSERT INTO `users` VALUES
('0','','','','0','0','0','','','0','0','0','0','0',null,'','','',null);";
//$result = mysql_query($SQL, $con) or die('A error occured: ' .
mysql_error());
$result = mysqli_query($con, $SQL) or die('A error occured: ' .
mysql_error());
//$SQL = "select * from sessions, users;";
$SQL = "SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid =
s.uid
WHERE s.sid = '18iipbZORE4AAAASzgBVAu'";
//$result = mysqli_query($con, $SQL) or die('A error occured: ' .
mysql_error());
//$result = mysql_query($SQL, $con) or die('A error occured: ' .
mysql_error());
$result = mysqli_query($con, $SQL) or die('A error occured: ' .
mysql_error());
// Get result count:
$Count = mysql_num_rows($result);
print "Showing $count rows:<hr/>\n\n";
// Fetch rows:
while($Row = mysqli_fetch_array($result)) {
print $Row[0].', '.$Row[1].', '.$Row[2] . "<br>";
}
mysqli_close($con);
?>
Let me know if you need anything else. Thanks.