function dbConnect()
{
$link = mysql_connect('localhost', 'ch05', '12345');
if (!$link)
echo "test";
return false;
mysql_close($link);
echo "test2";
return false;
}
return true;
}
{
$query = 'select item_id, title from items order by ranking, lower(title)';
$result = mysql_query($query);
while ($row = mysql_fetch_object($result)) {
$items[$row->item_id] = $row->title;
}
}
{
if (!isset($_POST[$key]) || !is_array($_POST[$key]))
return false;
foreach ($_POST[$key] as $id) {
if (!array_key_exists($id, $items))
continue;
$ranking,
$id);
mysql_query($query);
$ranking++;
}
return true;
}
?>