Jump to content


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


Not sure what I am Doing

Recommended Posts


I am trying to alter some code to try and understand it, I have a page called amend.php, it shows me all records in my table (agent_details), i can type a record number in and then hit submit and it should go to amend1.php, this iswhere it goes wrong, I have tried to edit the coding and I am getting lost, i get an error saying "Parse error: syntax error, unexpected $end in C:\wamp\www\amend1.php on line 62"
here is the amend1.php in full.


$record = $_POST['record'];
echo "Reference Number: $record<br><BR>";

$host = "localhost";
$login_name = "root";
$password = "";

//Connecting to MYSQL

//Select the database we want to use
mysql_select_db("performance_tracker") or die("Could not find database");

$result=mysql_query(" SELECT * FROM agent_details WHERE IDNumber='$record'");
while ($i < $num) {

// collect all details for our one reference
$thumb=mysql_result($result,$i,"Date Of Birth");

$f='<font face=Verdana,Arial,Helvetica size=2 Color=Blue';

//next we display only the details we want to allow to be changed in a form object
// the other details that we won't allow to be changed can be echoed to the screen
//note the hidden input line 3 below. We don't need to echo it to the screen


<FORM ACTION="amend2.php" METHOD="post">
<INPUT TYPE="hidden" NAME="IdNumber" VALUE="<? echo "$record" ?>">
<BR>Agent Name:<BR><TEXTAREA NAME="AgentName" COLS="50" ROWS="4">
<? echo "$description"?></TEXTAREA></P><P ALIGN="LEFT">Description:<BR>
<TEXTAREA NAME="ud_text2" COLS="50" ROWS="4"><? echo "$text2"?></TEXTAREA></P><HR><B>
</B><P ALIGN="LEFT">Thumbnail:<BR> <INPUT TYPE="text" NAME="ud_thumb" VALUE="<? echo "$thumb"?>" SIZE="30" MAXLENGTH="50"></P><P ALIGN="LEFT">Image
1 :<BR> <INPUT TYPE="text" NAME="ud_img1" VALUE="<? echo "$img1"?>" SIZE="30" MAXLENGTH="50"></P><P ALIGN="LEFT">Image
2 :<BR> <INPUT TYPE="text" NAME="ud_img2" VALUE="<? echo "$img2"?>" SIZE="30" MAXLENGTH="50"></P><P ALIGN="LEFT">Image
3 :<BR> <INPUT TYPE="text" NAME="ud_img3" VALUE="<? echo "$img3"?>" SIZE="30" MAXLENGTH="50"><BR><BR>
</P><P><INPUT TYPE="Submit" VALUE="Update the Record" NAME="Submit"> </P></FORM></TD></TR></TABLE>


can someone please tell me what I have or havnt done and how to get it show the record in a table, that I have selected on amend.php, as I believe this is what it is trying to get me todo, but i can get it to work.


Share this post

Link to post
Share on other sites
First find the error . Replace

[code]$result=mysql_query(" SELECT * FROM agent_details WHERE IDNumber='$record'");[/code]



$sql= "SELECT * FROM agent_details WHERE IDNumber='$record' ";
echo $sql;

$result=mysql_query ($sql) or die (mysql_error()); [/code]

Another thing

while ($i < $num) {[/code]

If $i=0, then 0 will always be less than $num , correct ?

Share this post

Link to post
Share on other sites


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.