0

//I used the following command to hyperlink:

$result_id1 = mysql_query("SELECT * FROM query order by case_id");
for ($i=0; $row1=mysql_fetch_array($result_id1); $i++)
{
//case_no is a field in the table "query"
echo "<TD><b><a href='http://localhost/test/details.php?case=$row1[case_no]'> $row1[case_no]</a></b> </TD>";
}

//now the file details.php is something like:

$case= $_REQUEST;
// after the connection and all
$result_new = mysql_query("SELECT * FROM query WHERE case_no = '$case'") or die ("Error: ".mysql_error());
$row=mysql_fetch_array($result_new);

//After i do this, I am getting a blank when i try to display a field of the table "date_rec"

echo $row[date_rec];

please help me out asap...
see "case_id","case_no" and "date_rec" are the fields in the table "query"

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Shanti C
0

try to print the query string $_REQUEST['case']; and print this query and execute that query in phpmyadmin: echo "SELECT * FROM query WHERE case_no = '$case'"; and also try to change the code like:

$result_id1 = mysql_query("SELECT * FROM query order by case_id");
while($row1=mysql_fetch_array($result_id1))
{
$cno=$row1[case_no];
//case_no is a field in the table "query"
echo "<TD><b><a href='http://localhost/test/details.php?case=$cno'> $cno</a></b> </TD>";
}

Edited by Shanti C: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.