Jump to content


Photo

Live data feed


  • Please log in to reply
4 replies to this topic

#1 Briant142

Briant142
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 21 July 2006 - 03:14 AM

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

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

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?

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 21 July 2006 - 03:47 AM

You connect to your database using mysql_connect(). You then reference the table using sql (structured query language), nothing to do with php really.

#3 Briant142

Briant142
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 21 July 2006 - 03:52 AM

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'];


#4 Briant142

Briant142
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 21 July 2006 - 11:58 PM

where do I insert mysql_connect() to attach to my dbase?  Do I insert it in the index.php?

#5 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 22 July 2006 - 12:11 AM

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.
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users