This topic is locked
[SOLVED]

 Flush table button

3/30/2011 12:36:36 PM
PHPRunner General questions
C
choanhemnhe author

Hi members,

my PHP project connecting to MS. SQL server. I'm creating a button to empty a tabel name "members" in ms.sql server. I did as follow
Create a button, then add the following command to "Server" tab
mssql_query("TRUNCATE TABLE members"); //does not work
I tried another
mssql_query("TRUNCATE TABLE [members]"); //does not work
then I tried



mssql_query("TRUNCATE TABLE 'members'");
// nope!
I tried
mssql_query("TRUNCATE TABLE [dbo].[members]"); //[dbo] is scheme with member table belongs to // not working too
tried
mssql_query("TRUNCATE TABLE dbo.members"); // does not work at all
If I connect the project to MySQL then I used this command

mssql_query("TRUNCATE members"); // it work
anyone know the result ?
thank a lot!

Admin 3/30/2011

Use the following:

CustomQuery("delete from members");


Ask yourself - do you really want anyone to delete all member records this way?

C
choanhemnhe author 3/30/2011

Wow! this command works like a charm <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=57353&image=1&table=forumreplies' class='bbc_emoticon' alt=':P' />. However, this does not reset id keys to zero. (it is not a big deal)
In fact, I want to flush another table. Table Members is a sample for my question
Thank admin <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=57353&image=2&table=forumreplies' class='bbc_emoticon' alt='B)' />