rahimah 0 Newbie Poster

means that after user select the option value and insert the value in input text, then they will click on search button.then the page will link to viewsearchbylocsoft.php. in this page, (viewsearchbylocsoft.php), it will view the searched data. the scripts looks alike but its different. 1st script for search the location, 2nd script for search the software, and 3rd script for search the IC number, that they had key in. i just combine all the 3 scripts to search all the inserted value (in txtSearch) that related to location,software and IC number. this means that i didn't put the script that will call the value in the drop box.
so, erm where should i put this scipt $select=$_REQUEST;
in my coding above? i know that i should remove the 2 scripts above and left just one script, but i just don't get what script should i put so that there is only one script and it search the value according to drop box value. erm can i have your email? so that i can send you the web interface.

rahimah 0 Newbie Poster

my dropdown box is in other page. here's the code.this page name searchbylocsoft.php


<form name="form1" method="post" action="viewsearchbylocsoft.php">
<table width="379" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="115" height="41"><label>
<select name="select">
<option value="LOCATION" selected>LOCATION</option>
<option value="SOFTWARE">SOFTWARE</option>
<option value="IC NUMBER">IC NUMBER</option>
</select>
</label></td>
<td width="264"><label>
<input name="txtSearch" type="text" id="txtSearch">

<?php

$connect = mysql_connect("localhost","root","") or die ("Could not connect to MYSQL database.");
mysql_select_db("sinventory") or die (my_sql_error());



$Location = $_REQUEST['txtSearch'];


$requestins = $Location . "%" ;


if($Location != "")
{
$sql = "SELECT * FROM requestins WHERE Location LIKE '".$requestins."'";

}
$result = mysql_query($sql) or die ("My SQL Error");
$num_rows = mysql_num_rows($result);




if($num_rows==0)
{
echo "<p><b></b></p>";

}
else
{
echo "<table border=1>";


while($column2=mysql_fetch_array($result))
{
extract($column2);

echo"<tr>";
echo"<td>Name</td>";
echo"<td>".$Name."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>IC Number</td>";
echo"<td>".$ICNo."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Location</td>";
echo"<td>".$Location ."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Exact Location</td>";
echo"<td>".$ELocation ."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Software Name</td>";
echo"<td>".$SwName ."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Remark</td>";
echo"<td>".$Notes ."</td>";
echo"</tr>";

}
echo"</table>";
}

?>
<?php

$connect = mysql_connect("localhost","root","") or die ("Could not connect to MYSQL database.");
mysql_select_db("sinventory") or die (my_sql_error());



$SwName= $_REQUEST['txtSearch'];

$requestins = $SwName . "%";


if($SwName != "")
{
$sql = "SELECT * FROM requestins WHERE SwName LIKE '".$requestins."'";

}
$result = mysql_query($sql) or die ("My SQL Error");
$num_rows = mysql_num_rows($result);




if($num_rows==0)
{
echo "<p><b></b></p>";

}
else
{
echo "<table border=1>";


while($column2=mysql_fetch_array($result))
{
extract($column2);

echo"<tr>";
echo"<td>Name</td>";
echo"<td>".$Name."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>IC Number</td>";
echo"<td>".$ICNo."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Location</td>";
echo"<td>".$Location ."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Exact Location</td>";
echo"<td>".$ELocation ."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Software Name</td>";
echo"<td>".$SwName ."</td>";
echo"</tr>";
echo"<tr>";
echo"<td>Remark</td>";
echo"<td>".$Notes ."</td>"; …
rahimah 0 Newbie Poster

im sorry, im so stupid today. can't think very brightly. this code below, shows result from inserting in one text field. so, it still search if i choose option value location, and insert an ic number. supposely it cannot search if i insert that value. i just insert all the code because i dont know where to declare and trace the option value. so, thats why it search all the value insert eventhough the option value is different

<?php

$connect = mysql_connect("localhost","root","") or die ("Could not connect to MYSQL database.");
mysql_select_db("sinventory") or die (my_sql_error());



$Location  = $_REQUEST['txtSearch'];


$requestins = $Location . "%" ;


if($Location != "")
{
    $sql = "SELECT * FROM requestins WHERE Location LIKE '".$requestins."'";

}
$result = mysql_query($sql) or die ("My SQL Error");
$num_rows = mysql_num_rows($result);




if($num_rows==0)
{
    echo "<p><b></b></p>";

}
else
{
    echo "<table border=1>";


    while($column2=mysql_fetch_array($result))
    {
        extract($column2);

        echo"<tr>";
        echo"<td>Name</td>";
        echo"<td>".$Name."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>IC Number</td>";
        echo"<td>".$ICNo."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>Location</td>";
        echo"<td>".$Location ."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>Exact Location</td>";
        echo"<td>".$ELocation ."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>Software Name</td>";
        echo"<td>".$SwName ."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>Remark</td>";
        echo"<td>".$Notes ."</td>";
        echo"</tr>";

    }
    echo"</table>";
}

?>

<?php

$connect = mysql_connect("localhost","root","") or die ("Could not connect to MYSQL database.");
mysql_select_db("sinventory") or die (my_sql_error());



$SwName= $_REQUEST['txtSearch'];

$requestins = $SwName . "%";


if($SwName != "")
{
    $sql = "SELECT * FROM requestins WHERE SwName LIKE '".$requestins."'";

}
$result = mysql_query($sql) or die ("My SQL Error");
$num_rows = mysql_num_rows($result);




if($num_rows==0)
{
    echo "<p><b></b></p>";

}
else
{
    echo "<table border=1>";


    while($column2=mysql_fetch_array($result))
    {
        extract($column2);

        echo"<tr>";
        echo"<td>Name</td>";
        echo"<td>".$Name."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>IC Number</td>";
        echo"<td>".$ICNo."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>Location</td>"; …
rahimah 0 Newbie Poster

how to implement it in coding above?

rahimah 0 Newbie Poster

i have this problem of mine, where i don't know the script if we want to retrieve the value of option value in turn to search data. i only the script to retrieve value from input type(text).
please help me on this.

i only know this. this script is to search value by retrieving data from input type text

<?php

$connect = mysql_connect("localhost","root","") or die ("Could not connect to MYSQL database.");
mysql_select_db("sinventory") or die (my_sql_error());



$Location  = $_REQUEST['txtSearch'];


$requestins = $Location . "%" ;


if($Location != "")
{
    $sql = "SELECT * FROM requestins WHERE Location LIKE '".$requestins."'";

}
$result = mysql_query($sql) or die ("My SQL Error");
$num_rows = mysql_num_rows($result);




if($num_rows==0)
{
    echo "<p><b></b></p>";

}
else
{
    echo "<table border=1>";


    while($column2=mysql_fetch_array($result))
    {
        extract($column2);

        echo"<tr>";
        echo"<td>Name</td>";
        echo"<td>".$Name."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>IC Number</td>";
        echo"<td>".$ICNo."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>Location</td>";
        echo"<td>".$Location ."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>Exact Location</td>";
        echo"<td>".$ELocation ."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>Software Name</td>";
        echo"<td>".$SwName ."</td>";
        echo"</tr>";
        echo"<tr>";
        echo"<td>Remark</td>";
        echo"<td>".$Notes ."</td>";
        echo"</tr>";

    }
    echo"</table>";
}

?>
rahimah 0 Newbie Poster

hi naveen tq .
you solve my problem.

rahimah 0 Newbie Poster

i have downloaded your coding few hours ago.
but somehow i have some problem there which is the calender just won't come out.
i had follwed the steps and put the coding at the right place but it wont come out.
i need to put a calender in a system which i had build recently.
and also, i have questions about this calender. this basic calender is used only to view the date or we can pick the date and the date choosen will appear/selected in the text field beside the calender?

here's the code. hoping to know the news from you as soon as possible

<?php require_once('Connections/cn.php'); ?>
<?php require_once('Connections/cn.php'); ?>
<?php session_start(); ?>
<?php

//$uname = $_REQUEST['txtuname'];

//$querysearch = ("SELECT StaffID, StaffIC, StaffName FROM staff WHERE StaffIC='.$uname.'");

//$search = mysql_query($querysearch, $cn) or die(mysql_error());
//$totalRows_search = mysql_num_rows($search);
//$rows_search= =mysql_fetch_assoc($search);

    /*      extract($rows_search);
            echo "<tr>"; 
            echo "<td>".$rows_search['StaffID']. "</td>";
            echo "<td>".$rows_search['StaffIC']. "</td>";
            echo "<td>".$rows_search['StaffName']. "</td>";
            echo "</tr>";
*/

//$staffID = $querysearch['StaffID'];
//$staffIC = $querysearch['StaffIC'];
//$staffName = $querysearch['StaffName'];

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : …