download from web sql database

Associate
Joined
8 Mar 2007
Posts
2,176
Location
between here and there
hey all,

I've got my self a website that has a sql database on it. The database currently holds data from an online form.

I'd like to have a automated script that can download the last entry from the database but I'm unsure how to go about it.

The hosting company have provided me with a "perl" and "php" string so I can connect, but I've never used either language, so I'm a bit lost.


Anyone got any ideas??

Cheers in advance :)
 
ok, I've installed wamp and I can now run xxx.php script from the command line.

I'm using this;

Code:
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'password';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'petstore';
mysql_select_db($dbname);
?>

am i right in thinking that "dbhost" should be my website address?? (www.xyz.com) the dbuser and dbpass are pretty clear, as is the dbname.

I'm getting an error "Fatal error: Call to undefind function mysql_err() on line 6"

any ideas?
 
Last edited:
You will be supplied an IP address for the database location.Have a look through some of the info on your account and you should find it.
 
dbhost should stay as 'localhost' unless your database and script are on different servers (unlikely).
 
Sorry guys I should mentioned that the sql server is hosted on my website and I'm running this php script from my local machine.

my bad.

I'll have a look for an IP now.
 
Would it not be easier (not to mention more secure) to just have a back-end admin system which you log in to and lists the entries in the database?
 
Would it not be easier (not to mention more secure) to just have a back-end admin system which you log in to and lists the entries in the database?

well, I'll be honest and say that I know next to nothing about coding and scripting on web sites.

I'm building this one as a sort of project, and as such I need to do a few things.

1 - user fills in a online form
2 - data from form is saved in database
3 - email sent to my server
4 - outlook vba, kicks off this script (if i ever get it to work) and it retrieves the latest data
5 - outlook uses data to email user and confirm details
6 - outlook creates an email to be sent 10minutes before the requested time (set by user)

So far I've managed to do all of the outlook stuff, without too many issues. But I'm struggling to get this to run. It might be because I'm at work and we have a Nazi firewall that blocks most things (I have tried testing on a machine not on our network, but it less than convenient)

Basically, as this is just a project, I can justify spending money or huge amounts of time on getting the web server to do the work. (and mainly cos I just don't know how!)

so this is where I'm at.

If anyones got a better solution, I'm all ears!!

;)
 
Back
Top Bottom