Hi, I have the following piece of code which serves for the most basic of searches:
<?php
session_start();
if(isset($_SESSION['IDNumber']) && !isset($_POST['Ticker'])) {
$IDNumber = $_SESSION['IDNumber'];
}
else {
$IDNumber = "";
$Ticker = $_POST['Ticker'];
}
$db = mysql_connect('host', 'username', 'password');
if(!$db) {
print "Error - cound not connect to server";
exit;
}
$er = mysql_select_db('prent32_FinDat');
if(!$er) {
print "Error - cound not connect to database";
exit;
}
if (isset($_POST['Ticker']) && $IDNumber=="") {
$result = mysql_query("SELECT * FROM General WHERE Ticker = '$Ticker'")
or die(mysql_error());
}
else if ($IDNumber!="") {
$result = mysql_query("SELECT * FROM General WHERE IDNumber = '$IDNumber'")
or die(mysql_error());
}
$num_rows = mysql_num_rows($result);
if ($num_rows <=0)
?>
All this is doing is starting a session from the input "ticker" around the corresponding "idnumber". I would like to expand this so that the user could enter one of three inputs, all of which could start a session around the IDNumber; exact matches for either "ticker" or "ticker2" and an exact match up to five letters for "name". How would this look?