viperfunk Posted June 21, 2006 Share Posted June 21, 2006 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 More sharing options...
Buyocat Posted June 21, 2006 Share Posted June 21, 2006 Try:Update `table` SET row1 = `$value1`, row2 = `$value2` WHERE somerow = `$somevalue`Or with the full PHP$_q = "UPDATE $tablename SET $row = '$value', $row2 = '$value2' WHERE $somerow = '$somevalue'"; Link to comment https://forums.phpfreaks.com/topic/12571-update-problem/#findComment-48177 Share on other sites More sharing options...
viperfunk Posted June 21, 2006 Author Share Posted June 21, 2006 Tried both of those solutions, still no error and no updating occurs. any other suggestions? Link to comment https://forums.phpfreaks.com/topic/12571-update-problem/#findComment-48217 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.