# PHPobject - save data to mysql

**URL:** <https://forum.kirupa.com/t/phpobject-save-data-to-mysql/162294>\
**Category:** programming\
**Created:** [September 11, 2005, 10:05pm UTC](https://forum.kirupa.com/t/phpobject-save-data-to-mysql/162294 "2005-09-11T22:05:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![philipip](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/philipip/32/1231_2.png) [@philipip](https://forum.kirupa.com/u/philipip)\
**Post date:** [September 11, 2005, 10:05pm UTC](https://forum.kirupa.com/t/phpobject-save-data-to-mysql/162294/1 "2005-09-11T22:05:24Z")

</div>

[color=Silver]hi,  
have been working with this piece of code for some hours… but has a bit lack of knowleg at php… (english is’nt my strongest side either)…

as;  
set\_mc.onPress = function()  
{  
FMSetContent = new PHPObject(“getContent”);  
FMSetContent.set\_item\_onResult = function(result)  
{  
trace (result);  
}  
$date = “11.09.05”;  
$title = “Test title”;  
$preface = “Test preface”;  
$content = “Test contnet”;  
$section\_id = “1”;  
FMSetContent.set\_item("$dbName", “$table”, $date, $title, $preface, $content, $section\_id);  
}  
set\_mc.txt.text = “SET”;

php;  
class getContent {

```
 function set_item($dbName, $table, $date, $title, $preface, $content, $section_id)
 {    
     
     $db = mysql_connect(db_host", "db_name", "db_pass");
     mysql_select_db($dbName, $db);
             
     $query = "INSERT INTO $table (date, title, preface, content, section_id)
               VALUES (".
                  "'".$HTTP_POST_VARS[$date]."',".
                  "'".$HTTP_POST_VARS[$title]."',".
                  "'".$HTTP_POST_VARS[$preface]."',".
                  "'".$HTTP_POST_VARS[$content]."',".
                  "'".$HTTP_POST_VARS[$section_id]."')";      
     $result = mysql_query($query);
     return $query;
     
     close_db();
 }
 
 function close_db()
 {
     mysql_close();
 }

```

}

the php code works in a way, but it only saves blank fields… someone who see what i’m doing wronge or not doing at all here?

Tried to find som tutorials about [PHPobject](http://ghostwire.com/), but there is’nt much out their…

[color=Black]made it…[/color]  
[/color]
