[PHP] executing pict and pass data to DB

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cooweck
Forum Newbie
Posts: 4
Joined: Thu Jul 09, 2009 2:42 am

[PHP] executing pict and pass data to DB

Post 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?
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: [PHP] executing pict and pass data to DB

Post 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?
cooweck
Forum Newbie
Posts: 4
Joined: Thu Jul 09, 2009 2:42 am

Re: [PHP] executing pict and pass data to DB

Post 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.
Post Reply