Note that there are some explanatory texts on larger screens.

plurals
  1. PO$_SESSION not forwarding variable correctly
    primarykey
    data
    text
    <p>user query database and certain table fields must be stored and used in other pages.</p> <p>in page 1 where the querytook place and prescription field is save in variable $_SESSION:</p> <pre><code>$query = " SELECT id, full_name, address, email, telephone, prescription FROM patients WHERE id LIKE '%" . $patient_id . "%'"; $PRESCRIPTION = 'prescription'; $_SESSION['memory1'] = $PRESCRIPTION; </code></pre> <p>in page 2 where variable need reusing, am using this: <code>&lt;?php echo "Our patient's prescription is: ".$_SESSION['memory1'];?&gt;&lt;/b&gt;</code></p> <p>problem is that in page one I re used variable like this:<code>&lt;?php echo htmlentities ($row[$PRESCRIPTION], ENT_QUOTES, 'UTF-8'); ?&gt;</code> and it outputs the actual field result correctly. But on page 2 it is 'literally' displaying the characters prescription rather than it's stored content. it's liek in page 2 'prescription' has lost it's meaning.</p> <p>I'm editing the question to confirm that I am using<code>&lt;?php echo "Our patient's prescription is: ".$_SESSION['memory1'];?&gt;</code> this code in page 2. therefore am referring to the stored variable.</p> <p>With regards to the post that replied that I'm being too literal in page 1, then how come it's echoing ok in page one when used $PRESCRIPTION variable? if the literal is stored. in page 1 I would also get the prob of page 2 which returns the word prescription. BUT no, in page 1 I get the actual table field data that I require. in page 2 I just get the prescription word.</p> <p>One last thing, I'm not using session_start, but am instead using ($_SESSION['user']) at start of every doc as I use a require("common.php"); that specifies conn etc.</p> <p>hope this clarifies further.</p> <p>thanks, waiting for your opinions</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload