Hi,
I am trying to update a row using an edit form by passing id of the row .. but it is not working .. can anybody find what went wrong ........
Code: [Select]echo '<a href="addedit.php?edit&id='.$row['id'].'" title="Edit This Member"';
echo '><img src="images/edit.png"></a>
if(isset($_GET['edit']))
{
$sql="select * from news where id=$_REQUEST[id]";
$row=mysql_fetch_row(mysql_query($sql));
$action="editnews";
$news=$row[2];
$subject=$row[1];
$button='Update news';
include 'newsForm.php';
exit();
}
if (isset($_POST['action']) and $_POST['action'] =='Update news')
{
$id=$_REQUEST['id'];
$sql='update NEWS SET news="'.$_POST['news'].'",subject ="'.$_POST['subject'].'",added=curdate() where news.id= "$id"';
if(mysql_query($sql))
echo "Updated";
} newsForm.php
Code: [Select]<form action=?<?php echo $action; ?> method="post">
<p><label>News Subject :</label><input name="subject" type="text" size="60" value="<?php echo $subject; ?>"></p>
<p><label>News :</label><textarea rows="20" cols="50" name="news" ><?php echo $news; ?></textarea></p>
<input type="hidden" name="id" value="<?php echo $id; ?>"/>
<p><input type="submit" name="action" value="<?php echo $button; ?>"></p>
</form>Pleas somebody let me know what went wrong ..Thanks in advance
PHP Programming error. Please help!
Hi there,Am making a website for a friend and have encountered a problem that i need fixing fast.I get this error when i try to run the code below: QuotePHP Error MessageWarning: Unexpected character
Comment Mod System Effects all rows...
Sorry if its confusing but here is whats going on: I have a table in a database called comments and there are alot of entries there but can manually be marked flagged with a 1. nevermind how that is
Undefined variable: adHTML
Hello:While checking my site error logs, I've noticed one repetitive error that fills the log file. The error is "PHP Notice: Undefined variable: adHTML in /.../bot_jrheader.php on line
mr8m - reverse document
Friends,
parsing error
can anyone explain this syntax error:Parse error: syntax error, unexpected T_IFThe error is occuring at the blank field check ie: if (!$_POST['username]...etc etc//check if form has been submittedif
how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt ?
how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt and so on 200-300 into file 3.txt ?in PHP of course.i don't know if i'm really that dumb or is it the 36 hours of no sleep that i can't
User registration and login
I don't know whether this is the correct forum, if not i apologise but am pretty desperate at the moment.I have a phpbb3 forum and have a custom registration form. the password is hashed usering the
mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscribe to a news letter . Those who subscribe will receive a monthly email. They can unsubscribe using
Variable Clash
In the past I've had variables clash. For example:Code: <?php $c = 5; $cat = "Molly"; $echo $cat . " is " . $c . " years old.";?>Before, I've seen it
How to give the privillege for triggers?
Hi,