Jump to content

Archived

This topic is now archived and is closed to further replies.

Briant142

Live data feed

Recommended Posts

I have created a webpage to accept live feed of data by vendor "posting" the data to my url using the following code

[code]$input = array();
$input['email'] = $_POST['email'];
$input['source'] = $_POST['source'];
$input['ts'] = $_POST['ts'];
$input['ip'] = $_POST['ip'];[/code]

I have created a database and a table.  How do I reference the database and table in my website to store the data posted to the database I have created?

Share this post


Link to post
Share on other sites
You connect to your database using [url=http://php.net/mysql_connect]mysql_connect[/url](). You then reference the table using sql (structured query language), nothing to do with php really.

Share this post


Link to post
Share on other sites
the  mysql_connect() should be in the index.php before $input = array();
$input['email'] = $_POST['email'];
$input['source'] = $_POST['source'];
$input['ts'] = $_POST['ts'];
$input['ip'] = $_POST['ip'];

Share this post


Link to post
Share on other sites
you insert the mysql code whenever you need it. if you're doing this processing in process.php, insert the connection there. you may find it helpful to have this connection code saved in a separated file, then include this file when needed.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.