PHP Connect auf DB2 ohne Node oder Database Directory

<pre><?php $conn_string = „DRIVER={IBM DB2 ODBC DRIVER – DB2COPY1};DATABASE=DB;HOSTNAME=SRV;PORT=50300;PROTOCOL=TCPIP;UID=User;PWD=PW;“; $connect = odbc_connect($conn_string, “, “); $query = „SELECT * from DWH.LIEFERANT“; // perform the query $result = odbc_exec($connect, $query); while($erg=odbc_fetch_array($result)) { print_r($erg); } ?>

HowTo: Accessing Sharepoint Foundationsserver with PHP / Zugriff auf Sharepoint Foundationsserver mit PHP

Ein einfaches Bespiel: <?php $authParams = array(„login“ => „DOMAINUSER“, „password“ => „PW“); $listName = „{LIST ID}“; $rowLimit = ‚150‘; $wsdl = „http://sharepoint-server/_vti_bin/Lists.asmx?WSDL“; $soapClient = new SoapClient($wsdl, $authParams); $params = array(‚listName‘ => $listName, ‚rowLimit‘ => $rowLimit); $rawXMLresponse = null; try{ $rawXMLresponse = $soapClient->GetListItems($params)->GetListItemsResult->any; } catch(SoapFault $fault){ echo ‚Fault code: ‚.$fault->faultcode; echo ‚Fault string: ‚.$fault->faultstring; die(); } […]

Howto: Script Autoimport Videofiles Mythtv

#!/usr/bin/php <? $db=mysql_connect(‚localhost‘,’root‘,’DBPW‘); mysql_select_db(‚mythconverg‘); echo mysql_errno() . „: “ . mysql_error(). „n“; $d = dir(„/home/video/“); while (false !== ($entry = $d->read())) { if  ( (substr(strtolower($entry),-4)==‘.avi‘) or (substr(strtolower($entry),-4)==‘.vob‘)  ) { echo $entry.“n“; $res=mysql_query(„select * from recorded where basename=’$entry’“); echo mysql_errno() . „: “ . mysql_error(). „n“; if (mysql_num_rows($res)==0) { echo „- not foundn“; mysql_query(“ INSERT INTO […]

HowTo: Mythtv Filename / Dateiname

Dateiname aus Aufzeichnungsname erstellen. #!/usr/bin/php <? function allow_text($email) { $text=$email; $chars = „ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-0123456789 „; // Erlaubte Zeichen $dummy = 0; $helper = „“; for ($i=0;$i<strlen($text);$i++) { for ($j=0;$j<strlen($chars);$j++) if ($text[$i]==$chars[$j]) $helper.=$text[                                                                                                 $i]; } return $helper; } $db=mysql_connect(‚localhost‘,’root‘,’DBPW‘); mysql_select_db(‚mythconverg‘); echo mysql_errno() . „: “ . mysql_error(). „n“; $res=mysql_query(„select *,date_format(starttime,’%d.%m.%Y %H:%i‘) as ‚dater‘ fr                                                                                                 om recorded where […]