Page 1 of 1
[PHP] executing pict and pass data to DB
Posted: Mon Jul 13, 2009 3:20 am
by cooweck
I want to excute "pict" program which is a combination tool
and then pass all the output to the DB; mysql
and it seems either using exec, passthru or system doesn't matter, does't it?
what should be done step by step?
Re: [PHP] executing pict and pass data to DB
Posted: Mon Jul 13, 2009 3:14 pm
by Darhazer
System won't give you the whole output
passtrough will output to the browser, so you need output buffering to get the data
exec can return array with every line of the output... if the output is text

shell_exec will return string with the whole output
And the last alternative is proc_open
So, what kind of data pict will return?
Re: [PHP] executing pict and pass data to DB
Posted: Mon Jul 13, 2009 11:50 pm
by cooweck
it returns this kind of table
below is a sample of the output(txt file)
Phone. MCO Accessory. VPS Bluetooth. VPC Bluetooth.
White. LBA-T950. off. off.
White. LBA-C300. on. off.
White. LBA-T950. on. off.
White. LBA-T950. off. on.
White. LBA-C300. off. off.
White. LBA-C300. on. on.
White. LBA-C300. off. on.
White. LBA-T950. on. on.