|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problems trying to use DELETE
Hi,
I'm trying to create a forum (which I've done but iot doesn't look very pretty!). So far you are able to post a message and read the posts but I am having trouble deleting posts. So far I have two files, one called delete.php PHP Code:
which lists all the messages so you can pick one to delete. Then when you click on the one you want to delete you go to delete_post.php PHP Code:
When I uncomment the print_r it displays the correct node to be deleted but when I try to delete it I get this error Quote:
I think I understand the problem with the header but I don't know why the syntax is wrong. If I just tell it to delete all the entries that works fines but obviously I don't want to do that! Any help would be greatly appreciated I've been Goggling for hours and nothing seems to work always the same or similar SQL Error Thanks, Tom |
|
#2
|
|||
|
|||
|
Code:
$resultupdate = odbc_exec($connect,"delete from forum where code= '".$code."'"); |
|
#3
|
|||
|
|||
|
I tried your suggestion swampBoogie but now I get a new warning message:
Quote:
Anymore ideas? Thanks for your help, Tom |
|
#4
|
|||
|
|||
|
What datatype is the column code defined as?
The error says that the column code is not comparable to a character value. If it is numeric the query should look like Code:
$resultupdate = odbc_exec($connect,"delete from forum where code= " . $code ); |
|
#5
|
|||
|
|||
|
I just solved the problem its similar to what you said:
Code:
$resultupdate=odbc_exec($connect,"delete from forum where code = $code"); Thanks for your help Tom |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Problems trying to use DELETE |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|