Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 18:18
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flash and AS 3 (Moderators: papachan, kofi addaquay)
| | |-+  loading data
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Print
Author Topic: loading data  (Read 1314 times)
lasmiveni
Server what's that
*
Posts: 20


View Profile Email
« on: 03/04/11, 16:06 »

Ok, reading almost all tutorials about saving/loading
now I'm able to save and load data using amfphp/mysql in local.

Going to the server...after setting all the parameters (host, user, dbname, passw) and new db,
I'm finaly able to save but not loading, I can not load the saved data, I spent 2 days to understand why,
unsuccessfully. Charles just says:

Loading:
Target        String       /1/onResult
Response   String       null
Content     Boolean     false


Saving
Target        String       /1/onResult
Response   String       null
Content     Boolean     Ok


What can I do more?   give me some cue pls.  Thank You
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #1 on: 03/05/11, 05:34 »

Enter your database admin panel (phpMyAdmin i.e) and check that the data is really saved in your DB, probably insertion fails and that's the reason you can't load

Jorge
Logged

lasmiveni
Server what's that
*
Posts: 20


View Profile Email
« Reply #2 on: 03/05/11, 09:44 »

Hi Jorge, thank you for your Help and Tutorials.

In my database admin panel the data are really saved as Charles confirms.
I use the following News.php (for saving/loading) found in your "savingAS3_" files:

Code:
<?php
class News
{
//Change this variables to match your needs
var $dbhost "XX.XXX.XXX.XX";
var $dbname "Sql212898_3";
var $dbuser "Sql212898";
var $dbpass "XXXXXXX";

function News()
{
$this->methodTable = array(
"getTitles" => array( //selects all available Titles
"description" => "Returns avaible Category of books",
"access" => "remote"// available values are private, public, remote
"returntype" => "recordSet"
),
"insertTitles" => array( //insert a row in database
"description" => "Returns avaible Category of books",
"access" => "remote"// available values are private, public, remote
"arguments" => array ("Title""Comments"),
"returntype" => "string"
)
);
// Initialize db connection
$this->conn mysql_pconnect($this->dbhost$this->dbuser$this->dbpass);
mysql_select_db ($this->dbname);
}
function getTitles()

return mysql_query("SELECT Title, Comments FROM Titles");
}
function insertTitles($Title$Comments)

$result mysql_query("INSERT INTO titles (Title, Comments) VALUES ('$Title', '$Comments')") ;
if ($result) return "Ok";
}
}
?>

I noticed that the same News.php found in your "loadingAS3_" files has an error at the end of the line 35:

Code:
'")) ;
 

instead of:

Code:
')") ;

Anyway I just deleted the "Image array" in the php file as in the database named "Sql212898_3", because I don't need it. That's all, I don't understand what I can do more to load successfully.

Can you please tell me if I'm doing something wrong? Thank You again!
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #3 on: 03/05/11, 15:27 »

Before any change, did work or never?

Jorge
Logged

lasmiveni
Server what's that
*
Posts: 20


View Profile Email
« Reply #4 on: 03/05/11, 18:31 »

no, also with the original version I can't load anything from the server..
but in local as I said everything works good.
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #5 on: 03/06/11, 13:01 »

Hi lasmiveni,
if you give us a life link, we can have a look.
Logged

happy flashing
Cool
Ronald
lasmiveni
Server what's that
*
Posts: 20


View Profile Email
« Reply #6 on: 03/06/11, 14:56 »

Hi Ronald,   Smiley
Thank You.

Yes:   www.autosaidaa.com

You must select a project > so you can see the icons on the right > you must go on the CV icon (not clicking) > at this point, every time the mouse goes over the CV icon AMFPHP should work and call just one of the comments saved into my DB, these comments go into two TextArea (they are on the stage) at the bottom of the other two for writing the comment > if you write something (or nothing), you can save the comment clicking the CV icon.

In local the whole idea works fine…
« Last Edit: 03/06/11, 15:13 by lasmiveni » Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #7 on: 03/07/11, 07:47 »

Quote
Enter your database admin panel (phpMyAdmin i.e) and check that the data is really saved in your DB, probably insertion fails and that's the reason you can't load

Probably you didn't change DB credentials

Jorge
Logged

lasmiveni
Server what's that
*
Posts: 20


View Profile Email
« Reply #8 on: 03/07/11, 09:11 »

Hi Jorge

I checked my DB, the data are always saved (I can see the new comments)...when the message "thank you" appears. I don't know if I've to do something more and how to do it. Or how can I change/check my DB credentials?
Thank You
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #9 on: 03/07/11, 09:41 »

The getNews method comes empty, but whitout error, that means probably that query is wrong. Copy& paste que query inside the method and check (inside phpMyAdmin) that it returns some data. Currently on lour live site is just come empty

Jorge
Logged

lasmiveni
Server what's that
*
Posts: 20


View Profile Email
« Reply #10 on: 03/07/11, 09:51 »

Yes, I can see it too, it comes empty with a "false reply".
I'm not able to see credentials in my mysql as I can inside XAMPP,
I sent an email to the server master to know why...

I'll try to understand what you suggest, I'm not an expert...as you already know it.
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #11 on: 03/07/11, 10:00 »

Well, basically you need to change this:

//Change this variables to match your needs
   var $dbhost = "localhost";
   var $dbname = "anastasio";
   var $dbuser = "root";
   var $dbpass = "";

Yo match your DB needs

Jorge
Logged

lasmiveni
Server what's that
*
Posts: 20


View Profile Email
« Reply #12 on: 03/07/11, 10:22 »

ah... Wink you mean these credentials, ok.
They are ok, I can write/save the comments - I can see the comments saved in my DB - I can really see them, I can change their ID, Title, Comments - save them again and again... - but I can't load them -

Probably I'm victim of an illusion...
That's not irony..it's desperation!
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #13 on: 03/07/11, 10:36 »

This is the query in getTitles method:

SELECT Title, Comments FROM Titles

The name of your table is Titles. Be sure you follow Uppercase/Lowercase in all cases (name of the table, name of the fields), while Windows is lazy on this, Linux server follow strictly capitalization

Copy and paste the query in PhpMyAdmin and check you get results

Jorge
Logged

lasmiveni
Server what's that
*
Posts: 20


View Profile Email
« Reply #14 on: 03/07/11, 14:44 »

Hey Jorge, THANK YOU!

After days…trying every kind of trick, sleeping into a smoking DB, talking with the server guru… the solution was absolutely simple and I must say that I gave it a little thought   Grin
Thanks to Ronald too.

best
MS
Logged
Pages: [1] 2 Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!