Ok i need help please ! Below you will find my code and Form. Prolem is that its not updating and I in the form, it brings up a url image url in the text area, and it looks ok, but the minute i hit the save button, it puts slashes before the qoutation marks. I then look into the db and it didnt save anything.
If you could please help me out here.
<?
require_once "common.php";
checklogin();
dbconnect();
if($submit == "Saved"){
$query2 = "update affprograms set id='$id', image='$image', description='$description', status='$status' where id='$id'";
mysql_query($query2) or die( "ERROR: " . mysql_error() . "\n");
$res="Successfully updated";
}
$query="SELECT id, image, description, status from affprograms where id='$id'";
$result = mysql_query($query) or die( "ERROR: " . mysql_error() . "\n");
if ($myrow = mysql_fetch_array($result)) {
$id=$myrow["id"];
$image=$myrow["image"];
$description=$myrow["description"];
$status=$myrow["status"];
}
?>
This is the form :
<form action="editprogram.php" method=post>
<table>
<tr><td>#</td><td><?echo $id;?></td></tr>
<TR>
<TD valign=top><FONT SIZE="-1">Affiliate Code:<br>88x31 Image Only<br>Make Sure Image is clickable</FONT></TD>
<TD><textarea name="image" cols=50 rows=3><?echo $image;?></textarea></TD>
</TR>
<TR>
<TD valign=top><FONT SIZE="-1">Description:</FONT></TD>
<TD><textarea name="description" cols=50 rows=4><?echo $description;?></textarea></TD>
</TR>
<tr><td>Status</td><td>
<select name=status>
<option value="1" <?if($status == 1) echo "selected"?>> 1
</select>
</td></tr>
<tr><td colspan=2><input type=submit name="submit" value="Saved"></td></tr>
</table>
</form>