Search This Blog

Showing posts with label Dreamweaver. Show all posts
Showing posts with label Dreamweaver. Show all posts

Tuesday, June 2, 2009

On9Ads.com - 2nd June

I finally got it figured out! Again, another issue came to my mind and I was stumped for 2 days before picking out answers from here and there and finally got the answers I wanted. I kept on looking and looking but the answers are always weird and too complicated to be implemented. Some have tonnes of codes that make me even more frustrated. Its about working with Maths using PHP and MYSQL.

Example:-
User key in two numbers and the system calculates the product (multiplication) of both numbers. All three numbers must be stored into the database for later retrieval. So, how to do with Dreamweaver?

Solution:-
Again, a little bit of programming is required and full understanding of what you're trying to do is required. So, after creating a dynamic form with ADDT which inputs in both values. Then you have to make a Custom Trigger where the code will be like:-
<<

function Trigger_Custom(&$tNG) {
$a = $tNG->getColumnValue('multiply_1');
$b = $tNG->getColumnValue('multiply_2');
$c = $tNG->getColumnValue('multiply_id');
$total = $a*$b;
$sql = "UPDATE multiply_test SET multi_result = '$total' WHERE multiply_id = '$c'";
$result = mysql_query($sql);
}

>>
Where
multiply_test = your table name
multi_result = column that you want to place the results
And there you have it your simple product calculator!

Sunday, May 17, 2009

On9Ads.com - 16th May

I really feel like tearing the computer apart moments ago. this is really frustrating, but I've finally managed to get it working after a lots and lots of hardwork and research and countless trial and errors. I've finally managed to get the login function running. The issue was the connection to the remoter MySQL database.

So, the problem is that it was not possible to connect directly to the MySQL server remotely. I was only able to get it working by creating a database with mySQL and making connections with assumption that I'm in the web hosting server, therefore, the local info would have to be changed, where the http address is: http://yourdomainname.com (without the www). Then also, the MySQL Connection (under Database), must be as following:-

Connection Name: [ Any ]
MySQL server: localhost
User name: (cpanel login name)_(database user name)
Password: (database password)
Database: (cpanel login name)_(database name)

Where substitution is done accordingly, without the "(" and ")".
I've tried uploading it and test registration. It really works! I wonder how about retrieving data from database? Will it work? have to try and see. Anyways, again I ask, email me if anyone needs help with this at: siong_hean@hotmail.com.

Oh, and go to http://www.on9ads.com/register.php and try registering!
I will list the names of people who registered, in this blog when it reaches 5 people!