Advertisement:

Author Topic: how to create a simple function ?  (Read 686 times)

kiiks

  • Newbie
  • *
  • Posts: 21
how to create a simple function ?
« on: March 29, 2013, 05:47:10 am »
Hi everyone,

I just want to get a data in one of my DB...  So, is this ok like this ?

function my_function() {
        return (getMytable('myColumn'));


Thanks !!

kenbotong

  • Jr. Member
  • **
  • Posts: 98
  • Kenbotong Premium Service
Re: how to create a simple function ?
« Reply #1 on: March 29, 2013, 06:12:33 am »
try this

Code: [Select]
function get_data() {
$conn = getConnection();
$getdata = $conn->osc_dbFetchResult("SELECT data FROM %st_yourtable WHERE id = %d", DB_TABLE_PREFIX);
$data = $getdata('some_data');
return false/true ;
}

ken  ::)