setQuery($sql);$database->query();These codes have been simplified. I have included codes to throw me error messages, but no error messages are thrown and the table is simply not getting updated.I tried another solution, which was to delete and re-insert the whole row of data again. Inserting was not an issue (it had never been), but the same problem occurs when I try to delete. The row of data is not deleted and no error message are thrown.Any help will be greatly appreciated!Eric"> Database Table Update/Delete Issue - Forums

Forums

Database Table Update/Delete Issue

cire84 24 Jan, 2009
Hi,

I know this issue might have been brought up way too many times, but I have tried most solutions posted, but to no avail.

I have a form that allows users to update information in the database. The following php codes are placed in "On Submit code - after":

$sql = "UPDATE  #__events SET organiser='$_POST[organiser]' WHERE name='$select';";
$database->setQuery($sql);
$database->query();


These codes have been simplified. I have included codes to throw me error messages, but no error messages are thrown and the table is simply not getting updated.

I tried another solution, which was to delete and re-insert the whole row of data again. Inserting was not an issue (it had never been), but the same problem occurs when I try to delete. The row of data is not deleted and no error message are thrown.

Any help will be greatly appreciated!

Eric
GreyHead 24 Jan, 2009
Hi Eric,

Please post the 'unsimplified' code. It's impossible to tell what's wrong from this snippet. At the very least it should look something like this
<?php
$database =& JFactory::DBO();
$sql = "UPDATE  #__events SET organiser='$_POST[organiser]' WHERE name='$select';";
$database->setQuery($sql);
$database->query();
?>
and I still have no idea where '$select' comes from??

Bob
cire84 29 Jan, 2009
Hi Bob,

I have solved my problem all thanks to the one question that you asked....
"and I still have no idea where '$select' comes from??"

Thank you!

Regards,
Eric
This topic is locked and no more replies can be posted.