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 2346 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($sq l))
{
exit(mysql_erro r());
}
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($sq l))
{
exit(mysql_erro r());
}
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_ILLEG AL_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 Linux,
connecting to MS SQL Server, unless it was already pre-installed by
your Linux installation, is to build your own multithreaded TCP socket
server on Windows and connect to it through the socket API in PHP on
Linux (if you have installed...
|
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 to the db, and get error 2013.
I have tried with MySQL Administrator 1.0 and also with ODBC.
The db on linux has
grant all on *.* to ''@'10.0.0.%'
and also tried
.... to root@10.0.0.200
and others seen on posted messages.
I can access that db...
|
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 System.Data.SqlClient;
using System.Threading;
namespace TestSQL
{
class Class1
|
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 can use the same data. I have
gone through all the data connectors in Visual Basic.net and none of them
have the options for connecting to MySQL. Does anybody know how I would go
about doing this? Thanks in advance!
Jeremy
|
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...
| |
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.
http://msdn2.microsoft.com/en-us/library/system.data.odbc.odbcconnectionstringbuilder.dsn(VS.80).aspx
i looked through this url to see how could i connect to a mysql
database...where does the dsn figure out? why do i need to give it? i
cant see any dsn specified anywhere on the database control panel. i
am a...
|
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...
|
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 MysqlConnect {
|
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...
|
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...
|
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...
| |
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |