Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 9th, 2025, 9:20 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Post Web Data Tutorial need help
PostPosted: March 26th, 2009, 3:49 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
Hi All

I used the post web tutorial and it seems very explanatory , BUT i get a problem when i try and read back from the database ......I can send to it fine but pulling the data back wont happen OR wont display.

Is there away to see if you are getting an error from the script that pulls the data from the DB ?

Confused..----->

below is the script for pulling the information BUT how does my PUB aquire that information

<?php

$DBhost = "localhost";
$DBuser = "Datausername";
$DBpass = "password";
$DBName = "underwar_mydb";

$connect = mysql_connect($DBhost,$DBuser,$DBpass);
$db = mysql_select_db($DBName,$connect);
$query = "SELECT * FROM employees";
$result = mysql_query($query, $connect);

$row = mysql_fetch_array($result );
$data = "&first=".$row['first']."&last=".$row['last']."&address=".$row['address']."&position=".$row['position'];
echo $data

?>


Could some one explain the fetch process....

Al Barnes

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


For this message Al Barnes has been thanked by : mackavi


Last edited by Al Barnes on March 27th, 2009, 12:19 am, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 26th, 2009, 11:25 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Off topic but...

I wouldn't include your actual database login details openly on a forum. In fact, they should not be in the php script at all.

login details should be in a folder outside the web servers' document root and then use an 'include' in your php file.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 27th, 2009, 12:20 am 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
mackavi wrote:
Off topic but...

I wouldn't include your actual database login details openly on a forum. In fact, they should not be in the php script at all.

login details should be in a folder outside the web servers' document root and then use an 'include' in your php file.

Mack


Duely noted.........thought i put the generic 1 up

Al

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


For this message Al Barnes has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 27th, 2009, 1:41 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Al,

I think there were some recent posts on php stuff.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: March 27th, 2009, 1:47 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Al,

The script is fine and works with both Opus Actions and Opus Script.

Use something like:

var newData = InternetPostData("http://localhost/joomla/demo.php",false,true)


Debug.trace(newData.first)

to recall the data.

Basically, the echo $data bit in the PHP script is passing an object back to Opus. You then access the properties of that object using OOP.

You can see the object in action by simply running the PHP script from the URL.

Mack

P.S T&C = terms and conditions

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 27th, 2009, 11:15 am 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
mackavi wrote:
Hi Al,

The script is fine and works with both Opus Actions and Opus Script.

Use something like:

var newData = InternetPostData("http://localhost/joomla/demo.php",false,true)


Debug.trace(newData.first)

to recall the data.

Basically, the echo $data bit in the PHP script is passing an object back to Opus. You then access the properties of that object using OOP.

You can see the object in action by simply running the PHP script from the URL.

Mack

P.S T&C = terms and conditions



First off Thanks Mack and Guys

I realise this project looks over my head , but it's a challenge i have to take . OK mack where do i run that test script from ?

UPDATE <-----------------------------
Just by chance i saw an Icon saying for setup of remote servers click here . So i clicked and saw that it asked for server domain info for the contacting server . I went in and white listed my Class C IP's and VOLA i see data returing LOL .

Question ? : it says i have 4 records and i tried submiting a new one and it still displays the old one ? i guess it needs some kinda of a refresh...

You guys must hate a newbie like me , full of piss and vinager and 1 million questions ( smile )..

Al

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


For this message Al Barnes has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 27th, 2009, 11:34 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It Friday, and I'm getting muddled.

You run the php script from a folder inside your root - but the password bit should be outside.

You run the script-bit that I posted from your Opus page but pointing it at the URL for your PHP file.

Changed the remote server??? Are you talking about the cPanel from your webhost?

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 27th, 2009, 12:19 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
mackavi wrote:
It Friday, and I'm getting muddled.

You run the php script from a folder inside your root - but the password bit should be outside.

You run the script-bit that I posted from your Opus page but pointing it at the URL for your PHP file.

Changed the remote server??? Are you talking about the cPanel from your webhost?

Mack


Sorry to fry your Brain mack ,

Yea , the web panel at my host had an area about remote servers and the database . I went in and saw it had an allow area, so i allowed my class C IP's and it allowed the data to return to me....

SO the TEST/Tutorial worked <------------------
means i have to setup my own WEB server with Mysql though , so i can control it myself . I will start playing with it and see if i can figure out how to get it to keep sending me the newest record LOL ( already tried and failed ) it just keeps handing me the first 1 )...

So i will stand by untill you have a reasonable second to think..

Seriously , THANKS

Al

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


For this message Al Barnes has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 27th, 2009, 12:42 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Definitely fryday :-)

Still lost. The PHP script should be on your webserver like so:

http://www.underware.ca/database.php

The Opus publication should call the URL above.

There is no need to provide remote access to your databases. A PHP script in your webserver root has access already.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 27th, 2009, 8:01 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
mackavi wrote:
Definitely fryday :-)

Still lost. The PHP script should be on your webserver like so:

http://www.underware.ca/database.php

The Opus publication should call the URL above.

There is no need to provide remote access to your databases. A PHP script in your webserver root has access already.

Mack


Hi Mack,

Yes i have all scripts in the propper place ...

The script topost the data worked fine , the problem was to retrieve it . It wouldn't work even though i posted the script and all said it was fine . I then remembered a small icon in the web menu at my providers saying " REMOTE MYSql " i went to it and it said that i must assign access to the database by IP so as to cleaar their FIREwall......I did it

Now my Pubs accepts data back from the database , i find this kinda weird as it cant function that way as it would mean i would have to list every IP in the world so as to access my DB LOL....

I will attach a jpg of my web menu at my providers

I used PHPadmin to set the DB in[/img]


You do not have the required permissions to view the files attached to this post.

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


For this message Al Barnes has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 27th, 2009, 8:02 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
mackavi wrote:
Definitely fryday :-)

Still lost. The PHP script should be on your webserver like so:

http://www.underware.ca/database.php

The Opus publication should call the URL above.

There is no need to provide remote access to your databases. A PHP script in your webserver root has access already.

Mack


Hi Mack,

Yes i have all scripts in the propper place ...

The script topost the data worked fine , the problem was to retrieve it . It wouldn't work even though i posted the script and all said it was fine . I then remembered a small icon in the web menu at my providers saying " REMOTE MYSql " i went to it and it said that i must assign access to the database by IP so as to cleaar their FIREwall......I did it

Now my Pubs accepts data back from the database , i find this kinda weird as it cant function that way as it would mean i would have to list every IP in the world so as to access my DB LOL....

I will attach a jpg of my web menu at my providers

I used PHPadmin to set the DB in[/img]


You do not have the required permissions to view the files attached to this post.

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


For this message Al Barnes has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 28th, 2009, 10:30 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Al,

Remote Access shouldn't even figure into the equation. It to allow outside clients / servers access to the databases on your web providers server.

For example, I could run a database management tool from my office and connect to a database host by my web provider 1&1 or I could run a PHP script from the server in the my office and connect to a remote database.

Both the reading & writing PHP scripts that you are using should already on the same server hosting the database and thus remote access is not necessary and a very very bad idea to have to give out usernames / passwords to everybody you think needs access.

Try out the attached IMP. It should return the data from a database on my webserver and doesn't need remote access.

Mack


You do not have the required permissions to view the files attached to this post.

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 28th, 2009, 1:06 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
mackavi wrote:
Hi Al,


Try out the attached IMP. It should return the data from a database on my webserver and doesn't need remote access.

Mack



I tried it out and accessed it fine ,

I have just loaded a Web server software and i will get it ready for PHP and MY_Sql that way i 2 will be able to control it better , i also needed the web software for another use.....

Thanks for the Time Mack..............

Al

ps: taking the rest of the weekend off , will start training again on monday LOL

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


For this message Al Barnes has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 64 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group