First: I'm somewhat of a newbie to php. Just a forewarning.
I've been playing around with this code for about 4 hours. It's almost 2 AM now, and I'm finally deciding to throw in the towel. That, and I have to work tomorrow and I'll sit here trying to figure it all night if I don't ask here.
The code is below. I'm not sure what's wrong. The Query seems to pick up some variables, and the others it completely ignores. When I echo the query the variables show but they mysteriously disappear after the page reloads. No updates to the table or anything. I hope I'm explaining it right.
I thought I'd finally fixed it when I got to the point where I didn't get any syntax errors, but that hope was short-lived when the errors disappeared but the problem was the same.
Although I'm a newbie, I'll try my best to comprehend whatever it is you have to say that might help me. If someone can help me. I'd really appreciated it. Thanks.
<?
if (isset($_POST["id"]))
{
$ad_id=$_POST["ad_id"];
$plan=$_POST["plan"];
$url=$_POST["url"];
$description=$_POST["description"];
$clicksleft=$_POST["clicksleft"];
$ad_title=$_POST["ad_title"];
$query = "UPDATE ads SET ad_url='$url', ad_description='$description', clicksleft='$clicksleft', ad_title='$ad_title'
WHERE ad_id='$id'";
echo $query;
mysql_query($query) or die(mysql_error());
echo "<b>The Advertisement has been successfully edited.</b><br><br>";
}
if (isset($_GET["id"]))
{
$id=$_GET["id"];
$option=$_GET["option"];
if ($option=="edit"){
?>