Hello

I have tow queries on my website. A first query that extracts a number of records from my "Tutors" database based on the criteria "Location". This query works fine and returns "Id", "Name" and "HourlyRate".
I want my user to be able to see an extended profile for each record so I have for each record the following code:

$tmp = $row['Id'] ;
echo "<td> <a href = \"tutor_profile.php?id=" .$tmp ."\"> See Profile </a></td>";

The code on my tutor_profile.php page is:

$id=$_GET['id'];
$result = Mysql_query("	
SELECT * 
FROM `Tutors`
WHERE `Id` = '$id'
");

echo "Name: ".  $row['Name'];

But this second query returns nothing.

Any idea why? Thank for your help!

Recommended Answers

All 2 Replies

Hello

I have tow queries on my website. A first query that extracts a number of records from my "Tutors" database based on the criteria "Location". This query works fine and returns "Id", "Name" and "HourlyRate".
I want my user to be able to see an extended profile for each record so I have for each record the following code:

$tmp = $row['Id'] ;
echo "<td> <a href = \"tutor_profile.php?id=" .$tmp ."\"> See Profile </a></td>";

The code on my tutor_profile.php page is:

$id=$_GET['id'];
$result = Mysql_query("	
SELECT * 
FROM `Tutors`
WHERE `Id` = '$id'
");

echo "Name: ".  $row['Name'];

But this second query returns nothing.

Any idea why? Thank for your help!

hi, first you check whether the $ib come from tutors page
put echo in tutor_profile page check $id value come or no. you using $_get method, try once with $_request method also.

you didnt fetch query

mysql_fetch_assoc($result)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.