micheal1230 Posted April 18, 2012 Share Posted April 18, 2012 Well Im Tryin To Use A Command To Delete A SQL Table I Know I Can Delete THough PHP MyAdmin But This Is Incase Something Happens function delsql() executeSQLDelete("testtable") end addCommandHandler("deltable", delsql) The Script Is Server Link to comment
Kenix Posted April 18, 2012 Share Posted April 18, 2012 executeSQLQuery( "DROP TABLE `testtable`" ) or executeSQLDropTable( "testtable" ) Updated. Link to comment
Michael# Posted April 18, 2012 Share Posted April 18, 2012 @@Kenix, that's SQLite executeSQLQuery ( "DROP TABLE testtable" ); Edit: Ok, you changed already.. Anyway, you don't need `` in SQLite. Link to comment
Kenix Posted April 18, 2012 Share Posted April 18, 2012 Edit: Ok, you changed already.. Anyway, you don't need `` in SQLite. Lolwhat Link to comment
micheal1230 Posted April 18, 2012 Author Share Posted April 18, 2012 (edited) @@Kenix, that's SQLite executeSQLQuery ( "DROP TABLE testtable" ); Edit: Ok, you changed already.. Anyway, you don't need `` in SQLite. Doing That Doesnt Work It Says The Table Dont Exist And I DOnt MEan Sqlite I Mean The SQL You Get With XAMPP Edited April 18, 2012 by Guest Link to comment
Michael# Posted April 18, 2012 Share Posted April 18, 2012 (edited) @@Kenix, that's SQLite executeSQLQuery ( "DROP TABLE testtable" ); Edit: Ok, you changed already.. Anyway, you don't need `` in SQLite. Doing That Doesnt Work It Says The Table Dont Exist And I DOnt MEan Sqlite I Mean The SQL You Get With XAMPP I Mean The SQL You Get With XAMPP That's MySQL Edited April 18, 2012 by Guest Link to comment
Kenix Posted April 18, 2012 Share Posted April 18, 2012 (edited) My bad:/ I didn't read first post better. Your table not exists in registry.db ( all executeSQL .. functions working only with registry.db ) Also in XAMPP included Apache MySQL PHP Perl. Where you see sqlite? You working with mysql ... So use this functions: https://wiki.multitheftauto.com/wiki/DbConnect https://wiki.multitheftauto.com/wiki/DbExec https://wiki.multitheftauto.com/wiki/DestroyElement Edited April 18, 2012 by Guest Link to comment
micheal1230 Posted April 18, 2012 Author Share Posted April 18, 2012 Check your table in PMA. I Know Its There Cuz I Created It, It Is There Link to comment
Michael# Posted April 18, 2012 Share Posted April 18, 2012 You must create the table in phpMyAdmin and install mysql module. Then, use mysql_connect to connect to the database and mysql_query to manage. https://wiki.multitheftauto.com/wiki/Mysql Link to comment
micheal1230 Posted April 18, 2012 Author Share Posted April 18, 2012 You must create the table in phpMyAdmin and install mysql module.Then, use mysql_connect to connect to the database and mysql_query to manage. https://wiki.multitheftauto.com/wiki/Mysql Lol Guys I Done All This Shit i have xampp a successful LOCAL rp server Link to comment
Castillo Posted April 18, 2012 Share Posted April 18, 2012 I actually recommend to use the built-on (My)SQL functions dbConnect dbExec dbQuery dbPoll dbFree To drop a MySQL table you can do this: dbExec ( handler, "DROP TABLE `myTable`" ) Link to comment
Kenix Posted April 18, 2012 Share Posted April 18, 2012 He need use only ( for delete table ) So use this functions:https://wiki.multitheftauto.com/wiki/DbConnect https://wiki.multitheftauto.com/wiki/DbExec https://wiki.multitheftauto.com/wiki/DestroyElement local uConnection = dbConnect( -- arguments here ) -- connect to db dbExec ( uConnection, "DROP TABLE `testtable`" ) -- request destroyElement( uConnection ) -- close connection Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now