Jump to content

update problem


viperfunk

Recommended Posts

My update statement isn't returning an error, but is also not updating. Is there some flaw in my php? Here is the code:

<?php

if ($edit_record == 1)
{

$db->execute("UPDATE NEWS SET (p_title = ?, p_date = ?, p_body = ?, p_author = ?) WHERE p_id = ?", Array($title, $date, $body, $author, $id));

echo "<meta http-equiv='refresh' content='0' URL='http://MYURL/admin.php'>";
}
echo "<input type='hidden' name='edit_record' value='1'>";
echo "$row[0]";
echo "<input type='hidden' name='id' value=\"$row[0]\">";
echo "<input type='text' name='title' value=\"$row[1]\"><br>";
echo "<input type='text' name='date' value=\"$row[2]\"><br>";
echo "<textarea name='body' cols=50 rows=8>$row[3]</textarea><br>";
echo "<input type='text' name='author' value=\"$row[4]\"><br>";
echo "<input type='submit' value='edit'>";
echo "</form></td></tr>";
echo "<tr><td><hr size=2 width=800></td></tr>";
}
echo "</table>";

?>


Cheers
Link to comment
https://forums.phpfreaks.com/topic/12571-update-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.