I have a simple MySQl CRUD DB managed with simple html forms The input to some fields is literature text which can be quite complex in punctuation and entry is by those who require very precise correct punctuation.
I have an adequate answer (mysqli::real_escape_string) to getting the data in - which seems to cover all the cases I need. I have no problem in retrieving and simply displaying the string totally correctly but cannot find a satisfactory answer to inserting the retrieved value in a text field default value in an update form.
An example of the sort of string I am talking about is
Is this is a quote from Marlowe's Faust !!? & "WHY"
which when set as a default displays as
Is this is a quote from Marlowe's Faust !!? &
OR
Is this is a quote from Marlowe's Faust !!? & WHY"
which displays as
Is this is a quote from Marlowe's Faust !!? & WHY
A problem seems to arise when I have one or more sets of double quotes ( ") in the string.
I could handle that case if i was sure that was the only character that would give me a problem but I wonder if there are some other characters which I havent yet come across.
Additional Information the code snippet
<h2 style="color:RED"><u>UPDATE INFORMATION FOR RECORD </u></h2>
<h2 style="color:RED"><u>UPDATING IS NOW LIVE </u></h2>
<form action="/update/updater.php?">
<?php echo "Retrieved string is - ".$getRow['1'];?>
<p style="color:RED"><u><b>CHANGE OR ADD TITLE </b></u></p>
<label for="Ntitle"></label>
<input type="text" id=Ntitle" name="Ntitle" value= "<?php echo
$getRow['1'];?>" size="50" >
that results in
UPDATE INFORMATION FOR RECORD - LKDDM:1900.384.03 UPDATING IS NOW LIVE Retrieved string is - Is this is a quote from Marlowe's Faust !!? & "WHY" CHANGE OR ADD TITLE Is this is a quote from Marlowe's Faust !!? &
OR UPDATE INFORMATION FOR RECORD - LKDDM:1900.384.03 UPDATING IS NOW LIVE Retrieved string is - Is this is a quote from Marlowe's Faust !!? & WHY" CHANGE OR ADD TITLE Is this is a quote from Marlowe's Faust !!? & WHY
This is NOT a sanitizing question the data in the data base is fine - and as is require by the user - entry is well safe guarded.
It's this silly little formatting issue which is so frustrating