Giving values to variables stored in dbURGENT PLEASE HELP!!!
Posted: Fri Jun 20, 2003 5:59 am
Hi everyone
i've got variables stored in a 'text' datatype field in mysql. for example in a field called le_letter i store the following:
Dear $stu_pfname; $stu_plname,
$stu_fname1 $stu_fname2 $stu_lname has been accepted.
When i print this letter i make a query and set the values '$stu_fname1 $stu_fname2 $stu_lname' to be determined by this query and print them on a screen so that the user can print a letter out.
but
it seems like the values $stu_fname1 $stu_fname2 $stu_lname do not get assigned anything expect they display as '$stu_fname1 $stu_fname2 $stu_lname' on the screen.
anyone know how i can set variables in a field and then later give them values when they get displayed.
below is the code i use at the monet but it does not assign valuea to the variables stored in the field:
Thanks in advance
i've got variables stored in a 'text' datatype field in mysql. for example in a field called le_letter i store the following:
Dear $stu_pfname; $stu_plname,
$stu_fname1 $stu_fname2 $stu_lname has been accepted.
When i print this letter i make a query and set the values '$stu_fname1 $stu_fname2 $stu_lname' to be determined by this query and print them on a screen so that the user can print a letter out.
but
it seems like the values $stu_fname1 $stu_fname2 $stu_lname do not get assigned anything expect they display as '$stu_fname1 $stu_fname2 $stu_lname' on the screen.
anyone know how i can set variables in a field and then later give them values when they get displayed.
below is the code i use at the monet but it does not assign valuea to the variables stored in the field:
Code: Select all
<?php
//this is the query to determine the values that are stored in the le_letter field
$sql_letter_details = "select * from tbl_student,tbl_school,tbl_terms,tbl_school_venue where tbl_student.frn_scid = tbl_school.scid and tbl_school.frn_tid = tbl_terms.tid and tbl_school.frn_svid = tbl_school_venue.svid and tbl_student.stuid = $stuid";
$mysql_result_letter_details = mysql_query($sql_letter_details,$my_conn);
$get_letter_details = mysql_fetch_assoc($mysql_result_letter_details);
$stu_pfname = $get_letter_details['stu_pfname'];
$stu_plname = $get_letter_details['stu_plname'];
// this is the output of le_letter on the screen
echo str_replace(chr(13),"<br>",$get_letter_details['le_letter']);
?>Thanks in advance