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
Action script code -
function sendmail() {
-
var dbVar = new LoadVars();
-
db_path = "localhost/shop.php";
-
for (var i = 0; i<_root.mycart.length; i++) {
-
dbVar.itemdent = "ID: "+_root.mycart.getItemAt(i).id;
-
dbVar.ItemSize = "Size: "+_root.mycart.getItemAt(i).size;
-
dbVar.ItemProduct = "Product: "+_root.mycart.getItemAt(i).product;
-
dbVar.ItemQut = "Quantity: "+_root.mycart.getItemAt(i).qut;
-
dbVar.ItemPrice = "Price: "+_root.mycart.getItemAt(i).price;
-
}
-
dbVar.sendAndLoad(db_path, dbVar, "POST");
-
trace(dbVar);
-
}
-
_root.billing_mov.send_bt.onRelease = function() {
-
sendmail();
-
};
PHP code - <?php
-
// Make a MySQL Connection
-
require("db.php");
-
//creating a var
-
$var_itemdent = $_POST['itemdent'];
-
$var_itemQut = $_POST['itemQut'];
-
$var_itemProduct = $_POST['itemProduct'];
-
$var_itemSize = $_POST['itemSize'];
-
$var_itemPrice = $_POST['itemPrice'];
-
-
/* Strip any escape characters etc */
-
$var_itemdent = stripslashes($var_itemdent);
-
$var_itemQut = stripslashes($var_itemQut);
-
$var_itemProduct = stripslashes($var_itemProduct);
-
$var_itemSize = stripslashes($var_itemSize);
-
$var_itemPrice = stripslashes($var_itemPrice);
-
-
// Insert a row of information into the table "customer orders"
-
$q1 = "INSERT INTO customer orders (id, qut, products, size, price)
-
VALUES ('$var_itemdent', '$var_itemQut', '$var_itemProduct', '$var_itemSize', '$var_itemPrice')";
-
echo $q1;
-
mysql_close($con);
-
?>
[Please use CODE tags when posting source code. Thanks! --pbmods] 8 2327 pbmods 5,821
Recognized Expert Expert
Changed thread title to better describe the problem.
Changed thread title to better describe the problem.
Thanks for you help I'm new here
pbmods 5,821
Recognized Expert Expert
Heya, Zarwadi.
Thanks for you help I'm new here
Happens to the best of us.
-----
First things first, get some sleep.
Ok then.
The major problem I see is that you echo your SQL query, but you never actually send it. You will want to add these lines to your code after you define $sql: -
if(! mysql_query($sql))
-
exit(mysql_error());
-
ak1dnar 1,584
Recognized Expert Top Contributor
Hi Zarwadi,
Please let me know whether you could able to print those USER INPUTS from PHP end.before we enter them to MySQL.
Something like this. -
$var_itemdent = $_POST['itemdent'];
-
echo $var_itemdent ;
-
Thanks,
-Ajaxrand
Hi there I get 5 hours sleep, thanks for caring. Well I used the code you sent me and this was came up
Query was empty.
So it seems the action script code is not begging sent to the PHP. I know the LoadVar dbVar is working so, what am i doing wrong.
kind regards Zarwadi
Hi thanks for getting back to me so quickly. I tried the
echo $var_itemdent ; and nothing has came up. Someone else told me to try this,
if(! mysql_query($sql))
{
exit(mysql_error());
}
I did, and this come up
Query was empty
So it seems the actionscript is not sending the LoadVar
dbVar to the PHP. i'm confused
If you can help like I said before I would be very very greatful
Zarwadi
ak1dnar 1,584
Recognized Expert Top Contributor
Hi thanks for getting back to me so quickly. I tried the
echo $var_itemdent ; and nothing has came up. Someone else told me to try this,
if(! mysql_query($sql))
{
exit(mysql_error());
}
I did, and this come up
Query was empty
So it seems the actionscript is not sending the LoadVar
dbVar to the PHP. i'm confused
If you can help like I said before I would be very very greatful
Zarwadi
- <?php
-
// Make a MySQL Connection
-
//require("db.php");
-
//creating a var
-
-
# we will forget about Entering data to MySQL for now.-Ajaxrand
-
-
$var_itemdent = $_POST['itemdent'];
-
$var_itemQut = $_POST['itemQut'];
-
$var_itemProduct = $_POST['itemProduct'];
-
$var_itemSize = $_POST['itemSize'];
-
$var_itemPrice = $_POST['itemPrice'];
-
-
/* Strip any escape characters etc */
-
$var_itemdent = stripslashes($var_itemdent);
-
$var_itemQut = stripslashes($var_itemQut);
-
$var_itemProduct = stripslashes($var_itemProduct);
-
$var_itemSize = stripslashes($var_itemSize);
-
$var_itemPrice = stripslashes($var_itemPrice);
-
-
# If you cant echo the user inputs, which getting from Action Script
-
# means the problem is with your Action Script
-
# so fix it up.
-
echo $var_itemdent;
-
# rest of the code goes here
-
echo $var_itemPrice;
-
-
-
/*
-
// Insert a row of information into the table "customer orders"
-
$q1 = "INSERT INTO customer orders (id, qut, products, size, price)
-
VALUES ('$var_itemdent', '$var_itemQut', '$var_itemProduct', '$var_itemSize', '$var_itemPrice')";
-
echo $q1;
-
mysql_close($con);
-
*/
-
?>
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_ILLEGAL_VALUE), it has some thing to do with my PHP
kind regards
zarwdi
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Google Mike |
last post by:
After a lot of thought and research, and playing with FreeTDS and
InlineTDS, as well as various ODBC connections, I have determined that
the fastest and cheapest way to get up and going with PHP on...
|
by: kamilla |
last post by:
I have a mysql 3.5 server installed on a suse linux 8.1, with address 10.0.0.100.
Now I want to access that db from a W2K pc, address 10.0.0.200.
I am able to ping 10.0.0.100, but I cannot connect...
|
by: CodeImp |
last post by:
A simple app I quickly wrote to try getting info from a database. Here
is the first part of its code. The rest of the code is irellevant.
using System;
using System.Data;
using...
|
by: Jeremy Dillinger |
last post by:
I am trying to design a program that will use data from a MySQL database.
Currently all the data is being used with PHP scripts from a website. I am
also trying to build a software solution that...
|
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...
| |
by: Paradox Synthesist |
last post by:
hi,
i am a newbie to asp.net and have started learning mainly from
websites. i have a question which IS very silly and trivial.
...
|
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...
|
by: Ananthu |
last post by:
Hi
I have done all the codings part for connecting mysql with java in eclipse environment.
Coding Part:
import java.sql.Connection;
import java.sql.DriverManager;
public class...
|
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...
|
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,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |
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...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |