I posted this on the php 5 forum, but didnt get a response. It concerns database as well so I have posted it on here.
My host has recently made the upgrade to PHP 5.0, and the forms I had used to update and edit the text on my site, dont appear to work.
The text is just big chunks that include line breaks and numerous different text characters. When I try to update rows that are already in the table it doesnt work.
I send the data through a form, using the following code. The form is at update.php?prog_id=5 (for example)
<form name="form" form action="edit_prog_do2.php" method="post">
<input name="prog_id" type="hidden" id="prog_id" value="<? echo $prog_id; ?>" size="50">
<textarea name="description" cols="75" rows="15" id="description"><textarea></form>
Then to update the database I use:
$query = "UPDATE `progs` SET `description` = '$description' WHERE `prog_id` = '$prog_id' LIMIT 1";
$result = mysql_query($query) or die ("Unable to update description");
echo("description Updated!");
I have edited different fields fine, i.e fields that are just numbers etc.
However this field, which is a text field. Doesnt seem to update. Do i need to do something before using specific characters, ie. put a / in front of any " characters in the text ?
Its weird because I used the same form method to edit my site for years until the update to php 5 and now it doesnt work.
Any help will be most appreciated, its got me stumped.