|
|
| (4 intermediate revisions by the same user not shown) |
| Line 11: |
Line 11: |
| [https://fontawesome.com/icons/ See all the icons] | | [https://fontawesome.com/icons/ See all the icons] |
| <hr/> | | <hr/> |
| {{EpiphanyHelpText|21}} | | {{EpiphanyHelpText|Detail|457}} |
| <hr/> | | <hr/> |
| {{EpiphanyHelpText|53}} | | {{EpiphanyHelpText|Detail|504}} |
| <syntaxhighlight lang="php"><?php
| |
| $serverName = "sql01.crystalcomputer.com";
| |
| $connectionOptions = array(
| |
| "database" => "epiphany",
| |
| "uid" => "epiphany",
| |
| "pwd" => "ccc"
| |
| );
| |
| | |
| // Establishes the connection
| |
| $conn = sqlsrv_connect($serverName, $connectionOptions);
| |
| if ($conn === false) {
| |
| die(formatErrors(sqlsrv_errors()));
| |
| }
| |
| $hid=intval($_GET['hid']);
| |
| | |
| // Select Query
| |
| $tsql = "SELECT FlexScreenDetail.HelpText as HelpText
| |
| FROM FlexScreenMaster
| |
| LEFT JOIN Relationships Rel1 ON Rel1.ObjectID1=5 AND Rel1.ItemID1=FlexScreenMaster.ID AND Rel1.ObjectID2=6 AND Rel1.Type=0
| |
| LEFT JOIN FlexScreenDetail ON FlexScreenDetail.ID=Rel1.ItemID2
| |
| WHERE FlexScreenMaster.ID = $hid;";
| |
| | |
| // Executes the query
| |
| $stmt = sqlsrv_query($conn, $tsql);
| |
| | |
| // Error handling
| |
| if ($stmt === false) {
| |
| die(formatErrors(sqlsrv_errors()));
| |
| }
| |
| | |
| while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
| |
| $s = ltrim(rtrim($row['HelpText']));
| |
| if (strlen($s) > 0) {
| |
| echo "<p>$s</p>" . PHP_EOL;
| |
| }
| |
| }
| |
| | |
| sqlsrv_free_stmt($stmt);
| |
| sqlsrv_close($conn);
| |
| | |
| function formatErrors($errors)
| |
| {
| |
| // Display errors
| |
| echo "Error information: <br/>";
| |
| foreach ($errors as $error) {
| |
| echo "SQLSTATE: ". $error['SQLSTATE'] . "<br/>";
| |
| echo "Code: ". $error['code'] . "<br/>";
| |
| echo "Message: ". $error['message'] . "<br/>";
| |
| }
| |
| }</syntaxhighlight>
| |