Query ROOT Users DB


TO_DAYS('$date')"; $and++; } if ($uname != "") { $uname = addslashes($uname); if (!$and) $sql .= " WHERE "; if ($and) $sql .= " AND "; $sql .= "name LIKE '$uname'"; $and++; } if ($email != "") { $email = addslashes($email); if (!$and) $sql .= " WHERE "; if ($and) $sql .= " AND "; $sql .= "email LIKE '$email'"; $and++; } if ($institute != "") { $institute = addslashes($institute); if (!$and) $sql .= " WHERE "; if ($and) $sql .= " AND "; $sql .= "institute LIKE '$institute'"; $and++; } if ($hepexp != "") { if (!$and) $sql .= " WHERE "; if ($and) $sql .= " AND "; $sql .= "hepexp LIKE '%$hepexp%'"; $and++; } if ($experiment != "" && $hepexp == "") { $experiment = addslashes($experiment); if (!$and) $sql .= " WHERE "; if ($and) $sql .= " AND "; $sql .= "experiment LIKE '$experiment'"; $and++; } if ($category != "") { if (!$and) $sql .= " WHERE "; if ($and) $sql .= " AND "; $sql .= "category LIKE '%$category%'"; $and++; } if ($desc != "") { $desc = addslashes($desc); if (!$and) $sql .= " WHERE "; if ($and) $sql .= " AND "; $sql .= "description LIKE '%$desc%'"; $and++; } // raw SQL statement overrides other settings if ($mysql != "") $sql = $mysql; echo "The following query has been issued:

\n"; echo "$sql

\n"; // access database if ($db = mysql_connect("localhost", "nobody", "")) { if (mysql_select_db("root", $db)) { if ($result = mysql_query($sql, $db)) { $i = mysql_num_rows($result); if ($i == 0) { echo "No records found\n"; mysql_close($db); return; } echo "$i records found

\n"; echo ""; for ($i = 0; $i < mysql_num_fields($result); $i++) { $fname = mysql_field_name($result,$i); echo ""; } echo "\n"; while ($row = mysql_fetch_array($result)) { echo ""; for ($i = 0; $i < mysql_num_fields($result); $i++) { $s = ereg_replace("\n", "", $row[$i]); $s = trim($s); if ($s == "") echo ""; else echo ""; } echo "\n"; } echo "
$fname
-$row[$i]
\n"; } } mysql_close($db); } } else { // display form ?> Fill in the form below to query the ROOT Users DB.


       Desired columns:  regdate      name     email      institute
      (default is all)   experiment   hepexp   category   description


Since date: (Format: yyyy-mm-dd [hh:mm:ss]) Name: (% is the SQL equivalent of *) E-mail address: Company/Institute: HEP/NP Experiment: Alice Atlas CMS LHC-B Aleph Delphi L3 Opal NA45 NA48 NA49 Nomad WA98 Compass CDF D0 Brahms Phenix Phobos Star H1 Hera-B Zeus Finuda Kloe BaBar Belle Hades Jefferson Lab Other experiment: Type of use: High Energy/Nuclear Physics Scientific Commercial Private Description contains:


Direct raw SQL query: (example: select name from rootusers where institute like 'nikh%')


Back to the ROOT Home Page