// General Variables
//$table Set Localy for SQL connect
$dbname="Mario"; // Generally use on alinea.bg MySQL Server (You can add more tables inside this database, as your permissions are OK with that.)
// You cannot change this username and password (only Angel can)
$dbusername="Mario_mario"; // case-sensitive
$dbpassword="w23qsM5qws34A"; // case-sensitive
// End General Variables ( use command GLOBAL when called inside a function() )
?>
echo "";
if ($_POST['search']=="" or $_POST['search']==" ") { echo "
You have to supply a search string!
Please, go back!
"; exit; }
else {$search=$_POST['search'];}
?>
$table="personaldata";
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table order by Name"); //Select all users , sorted by the "Name" Field (We will get only the name, occupation and userid)
$num_members=mysql_num_rows($result); // Get number of the rows (number of members)
$ppcount=0;
while ($myrow=mysql_fetch_array($result)) {
$names[$myrow[11]]=$myrow[0];
$tosearchin=" ".$myrow[0].$myrow[1].$myrow[2].$myrow[3].$myrow[4].$myrow[5].$myrow[6].$myrow[7].$myrow[8].$myrow[9].$myrow[15].$myrow[16];
if (strpos($tosearchin,$search)!="") {
$ppcount++;
$pp[$ppcount]=str_replace($search,"".$search."",substr($tosearchin,strpos($tosearchin,$search)-10,40));
$ppid[$ppcount]=$myrow[11];
$ppname[$ppcount]=$myrow[0];
}
} // end while
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
?>
SEARCH RESULTS
Search string: echo $search; ?>
Profiles searched: echo $num_members; ?>
if (count($pp)!=0) { //found something
echo "Listing PERSONAL INFO Database
";
for ($ww = 1; $ww < count($pp)+1; $ww++) {
echo "$ww. Personal profile of $ppname[$ww]
";
echo "Found: ... $pp[$ww] ...
";
} // end for
} // end is found in prsonal info
$table="scientiestsinfo";
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table WHERE What='education'"); //Select all users , sorted by the "Name" Field (We will get only the name, occupation and userid)
$ppcount=0;
while ($myrow=mysql_fetch_array($result)) {
$tosearchin1=" ".str_replace(":"," ",$myrow[2]);
$tosearchin=str_replace("~"," ",$tosearchin1);
if (strpos($tosearchin,$search)!="") {
$ppcount++;
if ($ppcount==1) { echo "Listing Members : Education Database
"; }
echo "$ppcount. Personal profile of ".$names[$myrow[1]]."
";
echo "Found: ... ".str_replace($search,"".$search."",substr($tosearchin,strpos($tosearchin,$search)-10,40))." ...
";
}
} // end while
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
$table="scientiestsinfo";
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table WHERE What='experience'"); //Select all users , sorted by the "Name" Field (We will get only the name, occupation and userid)
$ppcount=0;
while ($myrow=mysql_fetch_array($result)) {
$tosearchin1=" ".str_replace(":"," ",$myrow[2]);
$tosearchin=str_replace("~"," ",$tosearchin1);
if (strpos($tosearchin,$search)!="") {
$ppcount++;
if ($ppcount==1) { echo "Listing Members : Experience Database
"; }
echo "$ppcount. Personal profile of ".$names[$myrow[1]]."
";
echo "Found: ... ".str_replace($search,"".$search."",substr($tosearchin,strpos($tosearchin,$search)-10,40))." ...
";
}
} // end while
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
$table="scientiestsinfo";
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table WHERE What='societies'"); //Select all users , sorted by the "Name" Field (We will get only the name, occupation and userid)
$ppcount=0;
while ($myrow=mysql_fetch_array($result)) {
$tosearchin1=" ".str_replace(":"," ",$myrow[2]);
$tosearchin=str_replace("~"," ",$tosearchin1);
if (strpos($tosearchin,$search)!="") {
$ppcount++;
if ($ppcount==1) { echo "Listing Members : Societies Database
"; }
echo "$ppcount. Personal profile of ".$names[$myrow[1]]."
";
echo "Found: ... ".str_replace($search,"".$search."",substr($tosearchin,strpos($tosearchin,$search)-10,40))." ...
";
}
} // end while
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
$table="scientiestsinfo";
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table WHERE What='interests'"); //Select all users , sorted by the "Name" Field (We will get only the name, occupation and userid)
$ppcount=0;
while ($myrow=mysql_fetch_array($result)) {
$tosearchin1=" ".str_replace(":"," ",$myrow[2]);
$tosearchin=str_replace("~"," ",$tosearchin1);
if (strpos($tosearchin,$search)!="") {
$ppcount++;
if ($ppcount==1) { echo "Listing Members : Interests Database
"; };
echo "$ppcount. Personal profile of ".$names[$myrow[1]]."
";
echo "Found: ... ".str_replace($search,"".$search."",substr($tosearchin,strpos($tosearchin,$search)-10,40))." ...
";
}
} // end while
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
$table="scientiestsinfo";
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table WHERE What='visits'"); //Select all users , sorted by the "Name" Field (We will get only the name, occupation and userid)
$ppcount=0;
while ($myrow=mysql_fetch_array($result)) {
$tosearchin1=" ".str_replace(":"," ",$myrow[2]);
$tosearchin=str_replace("~"," ",$tosearchin1);
if (strpos($tosearchin,$search)!="") {
$ppcount++;
if ($ppcount==1) { echo "Listing Members : Visits Database
"; }
echo "$ppcount. Personal profile of ".$names[$myrow[1]]."
";
echo "Found: ... ".str_replace($search,"".$search."",substr($tosearchin,strpos($tosearchin,$search)-10,40))." ...
";
}
} // end while
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
$table="scientiestsinfo";
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table WHERE What='selected publications'"); //Select all users , sorted by the "Name" Field (We will get only the name, occupation and userid)
$ppcount=0;
while ($myrow=mysql_fetch_array($result)) {
$tosearchin1=" ".str_replace(":"," ",$myrow[2]);
$tosearchin=str_replace("~"," ",$tosearchin1);
if (strpos($tosearchin,$search)!="") {
$ppcount++;
if ($ppcount==1) { echo "Listing Members : Selected Publications Database
"; }
echo "$ppcount. Personal profile of ".$names[$myrow[1]]."
";
echo "Found: ... ".str_replace($search,"".$search."",substr($tosearchin,strpos($tosearchin,$search)-10,40))." ...
";
}
} // end while
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
$table="scientiestsinfo";
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table WHERE What='conference reports'"); //Select all users , sorted by the "Name" Field (We will get only the name, occupation and userid)
$ppcount=0;
while ($myrow=mysql_fetch_array($result)) {
$tosearchin1=" ".str_replace(":"," ",$myrow[2]);
$tosearchin=str_replace("~"," ",$tosearchin1);
if (strpos($tosearchin,$search)!="") {
$ppcount++;
if ($ppcount==1) { echo "Listing Members : Conference Reports Database
"; }
echo "$ppcount. Personal profile of ".$names[$myrow[1]]."
";
echo "Found: ... ".str_replace($search,"".$search."",substr($tosearchin,strpos($tosearchin,$search)-10,40))." ...
";
}
} // end while
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
$table="scientiestsinfo";
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table WHERE What='conferencies'"); //Select all users , sorted by the "Name" Field (We will get only the name, occupation and userid)
$ppcount=0;
while ($myrow=mysql_fetch_array($result)) {
$tosearchin1=" ".str_replace(":"," ",$myrow[2]);
$tosearchin=str_replace("~"," ",$tosearchin1);
if (strpos($tosearchin,$search)!="") {
$ppcount++;
if ($ppcount==1) { echo "Listing Members : Conferencies Database
"; }
echo "$ppcount. Personal profile of ".$names[$myrow[1]]."
";
echo "Found: ... ".str_replace($search,"".$search."",substr($tosearchin,strpos($tosearchin,$search)-10,40))." ...
";
}
} // end while
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
?>