Jump to content

Storing and Calling a value--Please help me for my Funding.


gokhul

Recommended Posts

in-info-web4.informatics.iupui.edu/~gkkilaru/p3.php.

 

Please go through that link.

enter hsa:229 as kegg_id and submit. u will be taken to p4.php. when i click the view more option, i need to get more data regarding the gene name which u see in the p4.php page. i have created alternative tables for these. please go through the code and help me....this project gets me awarded with my Masters funding...so please help me

 

 

p3.php code

<HTML>

<head><title>Human Pathway Database</title></head>

<BODY>

<?php

echo("<h2><center>Human Pathway Database Search Wizard</center></h2>");

echo("<hr>");

echo("<center>Enter the details you want to search.");

echo ("<form method=post action=p4.php>");

echo ("<center>Search:  <input type=varchar name=search value=>");

echo ("<br><br>Search type:  ");

  $connect=mysql_connect('localhost','gkkilaru','gkkilaru') ;

mysql_select_db('gkkilaru_db'); /* Identify database */

$result = mysql_query('SELECT * FROM HPD'); /* Do the query */

$ncols=mysql_num_fields($result); /* How many columns (fields) */

echo("<select name=searchtype>");

for ( $i=0; $i <$ncols; $i++ )

{

$column_name=mysql_field_name($result,$i); /* field name */

echo("<option value=".$column_name.">". $column_name. "</option>");

}

echo ("</select>");

        mysql_free_result($result);

echo ("<br><br><input type=submit value=Submit><input type=reset value=Clear>");

echo ("</form>");

echo ("<br><center><a href=\"/~gkkilaru/p1.html\">Go Home</a></center>");

echo("</center><hr>");

?>

</BODY>

</HTML>

 

p4.php code

 

<HTML>

<head><title>Human Pathway Database </title></head>

<BODY>

<?php

echo("<h2><center>Results from Human Pathway Database</center></h2>");

echo("<hr>");

/*echo $_POST['search'];*/

/*echo $_REQUEST['search'];*/

import_request_variables('p','p_');

$connect=mysql_connect('localhost','gkkilaru','gkkilaru')

or die('could not open:'. mysql_error());

mysql_select_db('gkkilaru_db'); /* Identify database */

$result=mysql_query("SELECT * FROM HPD WHERE $p_searchtype='$p_search'");

/*echo $p_searchname;*/

/*echo $p_searchtype;*/

$ncols=mysql_num_fields($result); /* How many columns (fields) */

print "<table cellpadding=0 cellspacing=0 width=100% border=1 >";

print "<tr>";

for ( $i=0; $i <$ncols; $i++ )

{

$column_name=mysql_field_name($result,$i);/* field name */

print "<td align=center><b>".$column_name."</b></td>";

}

print "</tr>";

$total=0;

while ( $row = mysql_fetch_array($result) ) /* process result row-by-row */

{

print "<tr>";

$total++;

for ( $i=0; $i <$ncols; $i++ )

{

 

$column_value=$row[$i];            /* field value */

print "<td align=center>".$column_value . "</td>";

}

}

mysql_free_result($result);

echo ("<h3>Search for Result: Totally ". $total."- records found</h3>");

echo ("<br><center><a href=\"/~gkkilaru/p3.php\">Back</a></center>");

echo ("<br><center><a href=\"/~gkkilaru/p5.php\">View More</a></center>");

echo ("<hr>");

?>

</BODY>

</HTML>

 

p5.php code

 

<HTML>

<head><title>Human Pathway Database</title></head>

<BODY>

<?php

echo("<h2><center>Results from Human Pathway Database</center></h2>");

echo("<hr>");

/*echo $_POST['search'];*/

/*echo $_REQUEST['search'];*/

import_request_variables('p','p_');

$connect=mysql_connect('localhost','gkkilaru','gkkilaru')

or die('could not open:'. mysql_error());

mysql_select_db('gkkilaru_db'); /* Identify database */

$result=mysql_query("select * from HPD1 where HPD1.Gene_Name = (SELECT Gene_Name FROM HPD WHERE KEGG_ID='$p_search')");

/*echo $p_searchname;*/

/*echo $p_searchtype;*/

$ncols=mysql_num_fields($result); /* How many columns (fields) */

print "<table cellpadding=0 cellspacing=0 width=100% border=1 >";

print "<tr>";

for ( $i=0; $i <$ncols; $i++ )

{

$column_name=mysql_field_name($result,$i);/* field name */

print "<td align=center><b>".$column_name."</b></td>";

}

print "</tr>";

$total=0;

while ( $row = mysql_fetch_array($result) ) /* process result row-by-row */

{

print "<tr>";

$total++;

for ( $i=0; $i <$ncols; $i++ )

{

 

$column_value=$row[$i];            /* field value */

print "<td align=center>".$column_value . "</td>";

}

}

mysql_free_result($result);

echo ("<h3>Search for Result: Totally ". $total."- records found</h3>");

echo ("<br><center><a href=\"/~gkkilaru/p3.php\">Back</a></center>");

echo ("<hr>");

?>

</BODY>

</HTML>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.