We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Custom MySQL fields - adding data from outside?

Development and Programming

Paradise's avatar
Paradise
84 posts
13 years ago
Paradise's avatar Paradise

Hi,

I’m logging some data and normally the system writes the data to MySQL with a php file like that:

<?php
  include("conect.php");
  $link=Conection();
  $Sql="insert into temp (temp1,temp2)  values ('".$_GET["temp1"]."', '".$_GET["temp2"]."')";      
  mysql_query($Sql,$link); 
  header("Location: insert.php");
?>

The question is how to insert it into the EE db that i can use it in the templates.

A channel with custom fields for 10 or more sensors and data every 5 minutes is to much i think.

       
Gareth Davies's avatar
Gareth Davies
491 posts
13 years ago
Gareth Davies's avatar Gareth Davies

It’s not exactly clear what you are trying to achieve but the database class documentation should get you started:

http://ellislab.com/expressionengine/user-guide/development/usage/database.html

       
Paradise's avatar
Paradise
84 posts
13 years ago
Paradise's avatar Paradise

I know how to access db fields from EE (query module).

But first i need to great tables (without custom fields) i can send my data to. And i need to know how to but data from outside into this fields to access the data later trough the query module.

I don’t know if i can just create some tables via phpMyAdmin in the EE db and if yes if they need to have some special format.

       
Gareth Davies's avatar
Gareth Davies
491 posts
13 years ago
Gareth Davies's avatar Gareth Davies

The query module won’t help you here as you can only perform SELECT statements which is why I pointed you to the database class which is what you will need.

You can create any additional tables in the expressionengine database you desire and no special format is required, however you will likely want to continue with whatever prefix your expressionengine database tables have i.e. exp_table_name

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.