Change line 22 into this:
$result = mysql_query($query);
if(!$result) die('Error: '.mysql_error()."<br />\nQuery: ".$query);
This will give you the mysql error, which will give more details about what is wrong.
Main Topics
Browse All TopicsI'm new to PHP so this will probably be a simple question to answer. I am using zend_amf to pass strongly typed objects between PHP and Flex 3. Zend_AMF seems to be working fine as I'm able to retrieve records from mySQL and bind them to my data grids. The challenge I am having is with inserting data. When I create a new record in Flex I'm passing an object back to PHP to save in mySQL.
What is the syntax for inserting an object into mySQL? Do I have to pull out each attribute?
The code sample below demonstrates what I am attempting to do , without much success. I've attempted to debug and I'm getting a fault code 0 without any details.
Thanks in advance for your help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
hello coconutelegraph, , in your code -
$userFirstName = $tmp>userFirstName;
youleft out a -
$userFirstName = $tmp->userFirstName;
I am wondering about your use of the VOUser() object ? ?, you have this code -
$tmp = new VOUser();
$tmp = $userObj;
I do not think you need to Initialize a VOUser() object if the $userOb is a VOUser() object,
also, I wonder if the copied object is valid?
I think I would try using a passed Reference &$userOb for the object, instead of a Copied object as you do
>> you do not need to have the mysql_real_escape_string()
That is true if you use the mysqli::prepare() method. You can also use mysqli in the "oldfashioned" way, with mysqli::query(). In that case, you need to escape the input using mysqli::real_escape_string
http://php.net/manual/en/m
coconutelegraph, did you insert error checking like I suggested above? Do you get a mysql error?
cxr,
I did add the error checking but I'm not seeing any output (most likely due to my lack of experience with PHP). The file VOUser is called from Flex.
I have three seperate files for zend_amf
1.) index.php
2.) VOUser.php (user class)
3.) userService.php (which includes VOUser)
Any suggestions or workarounds? I've checked the PHP logs and they are ok. Thanks.
cxr,
No problem. This is a PHP/mySQL issue. The object is passed to PHP with all the right data. I've checked using Charles.
If you were testing a php file that instantiated multiple classes how would you go about testing? It seems that when I debug, the issue is that I'm unable to simulate the input of the query variables.
Thanks.
you say
" the issue is that I'm unable to simulate the input of the query variables"
from reading the first code of this question, I am not sure what you want (need) to test, if you want a test of the mysql_query()
you might try to insert strings instead of function passed variables
$userID = ''AnID';
$userFirstName = date("M j, g:i a");
$userLastName = 'LastName';
$userEmail = 'user@mail.net';
// now use the database INSERT query with the strings above to test
if you want to test the VOUser() object, after you place a value into the object, echo it out
$vouserObj->userID = 'ID654321';
echo $vouserObj->userID;
but I am guessing that you might mean something else for testing? ?
Business Accounts
Answer for Membership
by: coconutelegraphPosted on 2009-09-09 at 14:54:05ID: 25295938
I figured out why I was getting a Fault code zero. I've fixed it and now I get:
iveryInDou bt faultString:'Channel disconnected' faultDetail:'Channel disconnected before an acknowledgement was received'
faultCode:Client.Error.Del
which usually indicates a problem with the mySQL statement. thanks.