473,786 Members | 2,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Actionscript PHP and MySql Problem

34 New Member
Hi, I have been creating a simple flash site and I need to use PHP and MySql, which I have never done. And I really need help.
I've created a database but I can't get my action script to send my variable to my PHP code. I think my Mysql data base has been set up wrong, but because I have never done this before I don't know what I am doing wrong.
Please can some help me. I have not slept for 3 days
If anyone can help me i will be eternally greatful.

This is how for I've got

Expand|Select|Wrap|Line Numbers
  1.  
  2. function sendmail() {
  3. var dbVar = new LoadVars();
  4. db_path = "localhost/shop.php";
  5. for (var i = 0; i<_root.mycart.length; i++) {
  6. dbVar.itemdent = "ID: "+_root.mycart.getItemAt(i).id;
  7. dbVar.ItemSize = "Size: "+_root.mycart.getItemAt(i).size;
  8. dbVar.ItemProduct = "Product: "+_root.mycart.getItemAt(i).product;
  9. dbVar.ItemQut = "Quantity: "+_root.mycart.getItemAt(i).qut;
  10. dbVar.ItemPrice = "Price: "+_root.mycart.getItemAt(i).price;
  11. }
  12. dbVar.sendAndLoad(db_path, dbVar, "POST");
  13. trace(dbVar);
  14. }
  15. _root.billing_mov.send_bt.onRelease = function() {
  16. sendmail();
  17. };
  18.  
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // Make a MySQL Connection
  3. require("db.php");
  4. //creating a var
  5. $var_itemdent = $_POST['itemdent'];
  6. $var_itemQut = $_POST['itemQut'];
  7. $var_itemProduct = $_POST['itemProduct'];
  8. $var_itemSize = $_POST['itemSize'];
  9. $var_itemPrice = $_POST['itemPrice'];
  10.  
  11. /* Strip any escape characters etc */
  12. $var_itemdent = stripslashes($var_itemdent);
  13. $var_itemQut = stripslashes($var_itemQut);
  14. $var_itemProduct = stripslashes($var_itemProduct);
  15. $var_itemSize = stripslashes($var_itemSize);
  16. $var_itemPrice = stripslashes($var_itemPrice);
  17.  
  18. // Insert a row of information into the table "customer orders"
  19. $q1 = "INSERT INTO customer orders (id, qut, products, size, price)
  20. VALUES ('$var_itemdent', '$var_itemQut', '$var_itemProduct', '$var_itemSize', '$var_itemPrice')";
  21. echo $q1;
  22. mysql_close($con);
  23. ?>
  24.  
Jun 27 '07 #1
3 2444
endline
10 New Member
this may be a silly question, but did you set up an appropriate table in the SQL db?
i had my fun using the command prompt exercises while reading the sql manual, and then I discovered phpMyAdmin. its available on most hosts and greatly helps in setting up sql dbs.

usually, php and my sql will give errors (in great detail lol) any errors we should know about that might help someone trying to help you?
Jun 27 '07 #2
Zarwadi
34 New Member
Hi thanks for getting back to me,
I have found out that my flash code is not send the LoadVar to the PHP, I don't understand I have been coding in action script for over 7 years and I know how to send a Var but this time I'm stumped. When I trace the Loadvar every thing looks right.

Any help would be greatfuly received
Zarwadi

Actionscript code:
_root.billing_m ov.send_bt.onRe lease = function() {
db_path = "localhost/admin1/shop.php";
var dbVar = new LoadVars();
for (var i = 0; i<_root.mycart. length; i++) {
dbVar.itemdent = _root.mycart.ge tItemAt(i).id;
dbVar.ItemSize = _root.mycart.ge tItemAt(i).size ;
dbVar.ItemProdu ct = _root.mycart.ge tItemAt(i).prod uct;
dbVar.ItemQut = _root.mycart.ge tItemAt(i).qut;
dbVar.ItemPrice = _root.mycart.ge tItemAt(i).pric e;
}
dbVar.onLoad = function(succes s:Boolean) {
if (success) {
trace("Your info has been sent");
trace(dbVar);
} else {
trace("Error connecting to server.");
}
};
send_Result.sen dAndLoad(db_pat h, dbVar, "POST");
};
Trace output
07003%5F2=&onLo ad=%5Btype%20Fu nction%5D&ItemP rice= 26%2E00&ItemQut =1&ItemProduct= Gaucho%20pants& ItemSize= 14&itemdent=070 03%5F2
Jun 27 '07 #3
Zarwadi
34 New Member
[Hi I think i've found the problem, but I do not under stand it, do you know what this means

Re: [jQuery] Bug Report - Component returned failure code: 0x80070057 (NS_ERROR_ILLEG AL_VALUE), it has some thing to do with my PHP

kind regards
zarwadi
Jun 27 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1963
by: Matt | last post by:
Hello, I am attempting to get a software prototype UI/demo built in Flash to talk with existing C++ (so I can exchange data and commands between the application-software already developed in the C++ source with its prototype UI/demo to be built in Flash). Can anyone provide examples or guidance for such an effort? More details:
3
8633
by: paolazi | last post by:
Hello I have a problem: I have a database(mysql) with the following fields: test, descr, title I want to display them into a flash file. Now my php file called list.php (which collect the information from my database) is the following: <?php include_once '../library/config.php'; include_once '../library/opendb.php'; $query =mysql_query("SELECT * FROM `$table` ORDER BY(`title`DESC ");
0
1125
by: grouchy | last post by:
Hello everyone, hope u r all well. Got a bit of a simple question. I have a textArea box (mesgArea.text) where a user can write a simple message and then press a send button ("sendMsg"). All i really need is when that user presses the sendMsg button, for the message to be stored in the field called "messagedescription" in the "messages" table in mySQL database. Thus when i look in the actual database the message typed by the user in...
1
2633
by: itsthefocusman | last post by:
Hi everyone my name is Daniel, I would like some help. I am using Flash 8 to build a website. I have built the whole site within one flash movie by building the different sections of the site (i.e. Bio, Photos etc) along different parts of the main timeline, with each section animated in and animated out. My problem is I have the same set of buttons in a movie clip runnig through the whole flash movie. Because each section animates out I...
8
2346
by: Zarwadi | last post by:
Hi, I have been creating a simple flash site and I need to use PHP and MySql, which I have never done. And I really need help. I've created a database but I can't get my action script to send my variable to my PHP code. I think my Mysql data base has been set up wrong, but because I have never done this before I don't know what I am doing wrong. Please can some help me. I have not slept for 3 days If anyone can help me i will be eternally...
0
2878
by: gabrielk43 | last post by:
Hi I am new to Flex and I use Flex Builder 2 to make a web service client. So I have a web service in .NET(c#) with a simple web method that returns a string(no arguments). It works, I tested it using firefox. I have managed to consume the service in Flex by using MXML like this: <mx:WebService id="wsTestWebService" wsdl="http://localhost:3521/AjaxControlToolkitWebSite2/TestFlexService.asmx?wsdl"showBusyCursor="true"...
2
4847
by: mfsiddiq | last post by:
HI I am facing some problem with my as-js communication.I am passing a String expression to a javascript function using ExternalInterface.call function upon mouse click.My string expression is as follows str="x=callAS(id)" Inside my js function i am just using eval(str).callAS(id) contains a call to actionscript function to retrive the value of x using id.I am able to make call to the actionscript by registering the function using...
1
2895
by: cyra | last post by:
Hi guys, this is the first time I post in our forum, I would like to say thanks to whom reading this. I'm new to ASv3 and in stuck of dealing with a problem like this : I have some .fla file with text/image in it, say, it was a text of "I love U", and a picture of a heart, now I need to make some ActionScript embedded in the .fla file, then compile to a SWF file, say "valentine.swf" All I want, is that actionscript embedded in the SWF...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9960
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.