Skip to main content
August 19, 2008
Answered

Delete Record

  • August 19, 2008
  • 2 replies
  • 485 views
I have created a user list that when I click on a link to delete a record it goes to a page where I have created a button called delete user in a form tag.

My issue is that I have been going over this issue where I cannot seem to delete a user and when I click on my button called delete user I get an error that states "Incorrect table name". I really do not know why I am getting this error.

In my user list the link that goes to the deletion page is as follows...
delete.php?userID=<?php echo $row_userIDs['userID']; ?>

My delete.php page has the record set as follows...
SELECT *
FROM `user`
WHERE userID = colname

Name: colname
Type: Numeric
Default value: -1
Runtime value: $_GET['userID']

I do have a hidden field.
<input name="userID" type="hidden" id="userID" value="<?php echo $row_getUser['userID']; ?>" />

For my delete record it states as follows...
First check if variable is defined: Primary key value
Connection: conMyConnection
Table: user
Primary key column: userID [Check Box active] Numeric
Primary key value: Form Variable [userID]
After deleting , go to: index.php

I do not know what I am doing wrong. I tried different settings for the delete record wizard but still not luck. I am wondering if it is a DWCS3 setup because when I used to work on DWMX2004 and I am doing the same steps I would not get an error. So right now I am at a lost trying to figure out am I missing something here, maybe the position of the codes.

Has anyone experienced this issue and resolved it.
This topic has been closed for replies.
Correct answer
I have found the solution. Some how Dreamweaver CS3 adds ' ' to the SQL statement.

Dreamweaver adds the following...
$query_getUser = sprintf("SELECT * FROM '' 'user' WHERE 'userID' = %s", GetSQLValueString($colname_getUser, "int"));

What it should be is the following...
$query_getUser = sprintf("SELECT * FROM user WHERE userID = %s", GetSQLValueString($colname_getUser, "int"));

Is there a function in Dreamweaver CS3 to take out these quotes rather than doing it manually.

2 replies

August 20, 2008
I have changed everything to the following...
First check if variable is defined: URL Parameter [userID]
Connection: conMyConnection
Table: user
Primary key column: userID [Check Box active] Numeric
Primary key value: URL Parameter [userID]
After deleting , go to: index.php

I am still getting the same error message "Incorrect table name".
Correct answer
August 23, 2008
I have found the solution. Some how Dreamweaver CS3 adds ' ' to the SQL statement.

Dreamweaver adds the following...
$query_getUser = sprintf("SELECT * FROM '' 'user' WHERE 'userID' = %s", GetSQLValueString($colname_getUser, "int"));

What it should be is the following...
$query_getUser = sprintf("SELECT * FROM user WHERE userID = %s", GetSQLValueString($colname_getUser, "int"));

Is there a function in Dreamweaver CS3 to take out these quotes rather than doing it manually.
Inspiring
August 19, 2008
Try this:

First check if variable is defined: URL Parameter userID

Primary key value: URL Parameter userID

--
Ken Ford
Adobe Community Expert Dreamweaver/ColdFusion
Fordwebs, LLC
http://www.fordwebs.com


"AdonaiEchad" <webforumsuser@macromedia.com> wrote in message
news:g8d2ih$b2c$1@forums.macromedia.com...
>I have created a user list that when I click on a link to delete a record
>it
> goes to a page where I have created a button called delete user in a form
> tag.
>
> My issue is that I have been going over this issue where I cannot seem to
> delete a user and when I click on my button called delete user I get an
> error
> that states "Incorrect table name". I really do not know why I am getting
> this
> error.
>
> In my user list the link that goes to the deletion page is as follows...
> delete.php?userID=<?php echo $row_userIDs['userID']; ?>
>
> My delete.php page has the record set as follows...
> SELECT *
> FROM `user`
> WHERE userID = colname
>
> Name: colname
> Type: Numeric
> Default value: -1
> Runtime value: $_GET['userID']
>
> I do have a hidden field.
> <input name="userID" type="hidden" id="userID" value="<?php echo
> $row_getUser['userID']; ?>" />
>
> For my delete record it states as follows...
> First check if variable is defined: Primary key value
> Connection: conMyConnection
> Table: user
> Primary key column: userID [Check Box active] Numeric
> Primary key value: Form Variable [userID]
> After deleting , go to: index.php
>
> I do not know what I am doing wrong. I tried different settings for the
> delete
> record wizard but still not luck. I am wondering if it is a DWCS3 setup
> because when I used to work on DWMX2004 and I am doing the same steps I
> would
> not get an error. So right now I am at a lost trying to figure out am I
> missing something here, maybe the position of the codes.
>
> Has anyone experienced this issue and resolved it.
>

August 20, 2008
quote:

Originally posted by: Newsgroup User
Try this:

First check if variable is defined: URL Parameter userID
Yes, it is defined as URL Parameter userID

Primary key value: URL Parameter userID
Primary key is URL Parameter userID

All systems check, what's next.
--
Ken Ford
Adobe Community Expert Dreamweaver/ColdFusion
Fordwebs, LLC
http://www.fordwebs.com


"AdonaiEchad" <webforumsuser@macromedia.com> wrote in message
news:g8d2ih$b2c$1@forums.macromedia.com...
>I have created a user list that when I click on a link to delete a record
>it
> goes to a page where I have created a button called delete user in a form
> tag.
>
> My issue is that I have been going over this issue where I cannot seem to
> delete a user and when I click on my button called delete user I get an
> error
> that states "Incorrect table name". I really do not know why I am getting
> this
> error.
>
> In my user list the link that goes to the deletion page is as follows...
> delete.php?userID=<?php echo $row_userIDs['userID']; ?>
>
> My delete.php page has the record set as follows...
> SELECT *
> FROM `user`
> WHERE userID = colname
>
> Name: colname
> Type: Numeric
> Default value: -1
> Runtime value: $_GET['userID']
>
> I do have a hidden field.
> <input name="userID" type="hidden" id="userID" value="<?php echo
> $row_getUser['userID']; ?>" />
>
> For my delete record it states as follows...
> First check if variable is defined: Primary key value
> Connection: conMyConnection
> Table: user
> Primary key column: userID [Check Box active] Numeric
> Primary key value: Form Variable [userID]
> After deleting , go to: index.php
>
> I do not know what I am doing wrong. I tried different settings for the
> delete
> record wizard but still not luck. I am wondering if it is a DWCS3 setup
> because when I used to work on DWMX2004 and I am doing the same steps I
> would
> not get an error. So right now I am at a lost trying to figure out am I
> missing something here, maybe the position of the codes.
>
> Has anyone experienced this issue and resolved it.
>