Briant142 Posted July 21, 2006 Share Posted July 21, 2006 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? Quote Link to comment Share on other sites More sharing options...
trq Posted July 21, 2006 Share Posted July 21, 2006 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. Quote Link to comment Share on other sites More sharing options...
Briant142 Posted July 21, 2006 Author Share Posted July 21, 2006 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']; Quote Link to comment Share on other sites More sharing options...
Briant142 Posted July 21, 2006 Author Share Posted July 21, 2006 where do I insert mysql_connect() to attach to my dbase? Do I insert it in the index.php? Quote Link to comment Share on other sites More sharing options...
ryanlwh Posted July 22, 2006 Share Posted July 22, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.