-
delete from sql Database Question
var deleting:String = "DELETE from residents WHERE firstName= 'bob' AND lastName = 'smith' " ;
This delete statement works just fine however I am not able to figure out how to get input from text fields to replace the words "bob' and 'smith'
I think its a question of where to place the String quotation marks....it beats me!
Any help would be appreciated.
Thanks
-
.
Hi,
That line will delete the whole row in the database, I'm not sure why you are using it inside of flash I'm pretty sure it should be in the php file.
like so : $deleting = "DELETE FROM residents WHERE firstName='bob' AND lastName='smith'";
To replace or update data http://www.w3schools.com/php/php_mysql_update.asp
-
Originally Posted by fruitbeard
Hi,
That line will delete the whole row in the database, I'm not sure why you are using it inside of flash I'm pretty sure it should be in the php file.
like so : $deleting = "DELETE FROM residents WHERE firstName='bob' AND lastName='smith'";
To replace or update data http://www.w3schools.com/php/php_mysql_update.asp
I am attempting to write an Air for Desktop application using the Flash IDE. (Flash CC)
There is a great deal of information concerning as3 and the sql database.
However it is remarkable difficult to understand.
I am pleased that the entire row is deleted. What I am looking for is the means to have the WHERE(conditions) determined by text from input textfields
-
.
Hi,
I don't use Air but if it's the same then you need to send the data to the php file.
PHP Code:
function sendData(e:MouseEvent):void { var userVars:URLVariables = new URLVariables(); userVars.firstName = userName.text; userVars.lastName = lastName.text; userVars.anotherData1 = anotherName1.text; userVars.anotherData2 = anotherName2.text; userVars.anotherData3 = anotherName3.text;
var phpPath:String = "youPHPFile.php";
var sendUrl:URLRequest = new URLRequest(phpPath); sendUrl.method = URLRequestMethod.POST; sendUrl.data = userVars;
var dataLoader:URLLoader = new URLLoader(); dataLoader.dataFormat = URLLoaderDataFormat.VARIABLES; dataLoader.addEventListener(Event.COMPLETE, success,false,0,true); dataLoader.addEventListener(IOErrorEvent.IO_ERROR, failed,false,0,true); dataLoader.load(sendUrl); }
function success(e:Event):void { if (e.target.data) { trace(e.target.data); } else { trace("An error occured"); } }
function failed(e:IOErrorEvent):void { trace(e); }
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|