Forums

PHP

This topic is locked

SQL Statement

Posted 22 Feb 2007 17:41:33
1
has voted
22 Feb 2007 17:41:33 emma azeez posted:
hello everyone,

im a newbie here, and also new to PHP and stuff. i would really like to receive help from anyone here. im doing my final year project and im stuck with this SQL Statement. im using MySQL with PHP and is developing my system using Dreamweaver MX.

my problem goes like this:

1) i have a page with a session variable. I made a Recordset1 for the Session because I wanted to pull the data of the logged in user from another table in MySQL.

2) then, I want to Recordset (Recordset2) that Recordset1 to pull another data from another table.

3) the SQL statement's like this:

$query_Recordset2 = "SELECT * FROM student_evaluation WHERE StudentID = '$row_Recordset1['StudentID']'";

but the WHERE statement always return an error that goes like this:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\course_evaluation\cestudent\yy2_masterpage\student_page.php on line 38

4) whats wrong with this SQL statement?


i'm really glad if anyone comes to rescue for me, thank you very much in advance.

Replies

Replied 27 Feb 2007 13:54:32
27 Feb 2007 13:54:32 Roddy Dairion replied:
Try this.
$query_Recordset2 = "SELECT * FROM student_evaluation WHERE StudentID = '".$row_Recordset1['StudentID']."'";

Reply to this topic