Code: Select all
SET sql_notes = 0;
CREATE TABLE IF NOT EXISTS user(personid int(4) NOT NULL auto_increment, personname varchar(255), PRIMARY KEY(personid) );
SET sql_notes = 1;
Code: Select all
on mouseUp
addTable
end mouseUp
on addTable
global gConnectionID
put "SET sql_notes = 0;" &return into sqlCode
put "CREATE TABLE IF NOT EXISTS user(personid int(4) NOT NULL auto_increment, personname varchar(255), PRIMARY KEY(personid) );" &return after sqlCode
put "SET sql_notes = 1;" after sqlCode
revExecuteSQL gConnectionID, sqlCode
if the result is a number then
answer info "New table added."
else
answer error "There was a problem adding the table to the database:" & cr & the result
end if
end addTable