diff --git a/reference/mssql/functions/mssql-bind.xml b/reference/mssql/functions/mssql-bind.xml index ea5c136708..4049a3a1d2 100644 --- a/reference/mssql/functions/mssql-bind.xml +++ b/reference/mssql/functions/mssql-bind.xml @@ -121,7 +121,7 @@ , when using a non default port number $server = 'KALLESPC\SQLEXPRESS'; +// Connect to MSSQL $link = mssql_connect($server, 'sa', 'phpfi'); -if(!$link) -{ - die('Something went wrong while connecting to MSSQL'); +if (!$link) { + die('Something went wrong while connecting to MSSQL'); } ?> ]]> diff --git a/reference/mssql/functions/mssql-data-seek.xml b/reference/mssql/functions/mssql-data-seek.xml index 5a902f3097..b0068411b6 100644 --- a/reference/mssql/functions/mssql-data-seek.xml +++ b/reference/mssql/functions/mssql-data-seek.xml @@ -61,27 +61,24 @@ = 13'); -if(!$result) -{ +if (!$result) { die('Query failed.'); } // Select every 4th student in the results -for($i = mssql_num_rows($result) - 1; $i % 4; $i++) -{ - if(!mssql_data_seek($result, $i)) - { - continue; - } +for ($i = mssql_num_rows($result) - 1; $i % 4; $i++) { + if (!mssql_data_seek($result, $i)) { + continue; + } - // Fetch the row ... + // Fetch the row ... } // Free the query result diff --git a/reference/mssql/functions/mssql-execute.xml b/reference/mssql/functions/mssql-execute.xml index 320a4909fa..436773253b 100644 --- a/reference/mssql/functions/mssql-execute.xml +++ b/reference/mssql/functions/mssql-execute.xml @@ -58,9 +58,9 @@ $title = 'Test of blogging system'; $content = 'If you can read this, then the new system is compatible with MSSQL'; // Bind values -mssql_bind($stmt, '@author', 'Felipe Pena', SQLVARCHAR, false, false, 60); -mssql_bind($stmt, '@date', '08/10/2008', SQLVARCHAR, false, false, 20); -mssql_bind($stmt, '@title', $title, SQLVARCHAR, false, false, 60); +mssql_bind($stmt, '@author', 'Felipe Pena', SQLVARCHAR, false, false, 60); +mssql_bind($stmt, '@date', '08/10/2008', SQLVARCHAR, false, false, 20); +mssql_bind($stmt, '@title', $title, SQLVARCHAR, false, false, 60); mssql_bind($stmt, '@content', $content, SQLTEXT); // Execute the statement diff --git a/reference/mssql/functions/mssql-fetch-array.xml b/reference/mssql/functions/mssql-fetch-array.xml index 703c66b6c8..d80495f671 100644 --- a/reference/mssql/functions/mssql-fetch-array.xml +++ b/reference/mssql/functions/mssql-fetch-array.xml @@ -75,20 +75,16 @@ $query = mssql_query('SELECT [username], [name] FROM [php].[dbo].[userlist]'); // Check if there were any records -if(!mssql_num_rows($query)) -{ - echo 'No records found'; -} -else -{ - // The following is equal to the code below: - // - // while($row = mssql_fetch_row($query)) +if (!mssql_num_rows($query)) { + echo 'No records found'; +} else { + // The following is equal to the code below: + // + // while ($row = mssql_fetch_row($query)) { - while($row = mssql_fetch_array($query, MSSQL_NUM)) - { - // ... - } + while ($row = mssql_fetch_array($query, MSSQL_NUM)) { + // ... + } } // Free the query result diff --git a/reference/mssql/functions/mssql-fetch-assoc.xml b/reference/mssql/functions/mssql-fetch-assoc.xml index c5c955a8bb..9a0bd298dc 100644 --- a/reference/mssql/functions/mssql-fetch-assoc.xml +++ b/reference/mssql/functions/mssql-fetch-assoc.xml @@ -57,23 +57,21 @@ $query = mssql_query('SELECT [username], [name] FROM [php].[dbo].[userlist]'); // Check if there were any records -if(!mssql_num_rows($query)) -{ - echo 'No records found'; +if (!mssql_num_rows($query)) { + echo 'No records found'; } else { - // Print a nice list of users in the format of: - // * name (username) + // Print a nice list of users in the format of: + // * name (username) - echo '
    '; + echo '
      '; - while($row = mssql_fetch_assoc($query)) - { - echo '
    • ' . $row['name'] . ' (' . $row['username'] . ')
    • '; - } + while ($row = mssql_fetch_assoc($query)) { + echo '
    • ' . $row['name'] . ' (' . $row['username'] . ')
    • '; + } - echo '
    '; + echo '
'; } // Free the query result diff --git a/reference/mssql/functions/mssql-fetch-batch.xml b/reference/mssql/functions/mssql-fetch-batch.xml index 953a4cf227..d0702421e3 100644 --- a/reference/mssql/functions/mssql-fetch-batch.xml +++ b/reference/mssql/functions/mssql-fetch-batch.xml @@ -49,7 +49,7 @@ = 0) -{ - while($row = mssql_fetch_assoc($result)) - { - // Do stuff ... - } +while ($records >= 0) { + while ($row = mssql_fetch_assoc($result)) { + // Do stuff ... + } - --$records; + --$records; } -if($batchsize = mssql_fetch_batch($result)) -{ - // $batchsize is the number of records left - // in the result, but not shown above +if ($batchsize = mssql_fetch_batch($result)) { + // $batchsize is the number of records left + // in the result, but not shown above } ?> ]]> diff --git a/reference/mssql/functions/mssql-fetch-field.xml b/reference/mssql/functions/mssql-fetch-field.xml index ca84e9bf9d..2f8204cf0c 100644 --- a/reference/mssql/functions/mssql-fetch-field.xml +++ b/reference/mssql/functions/mssql-fetch-field.xml @@ -93,7 +93,7 @@ '; // Dump all fields echo ''; -for($i = 0; $i < mssql_num_fields($query); ++$i) -{ - // Fetch the field information - $field = mssql_fetch_field($query, $i); +for ($i = 0; $i < mssql_num_fields($query); ++$i) { + // Fetch the field information + $field = mssql_fetch_field($query, $i); - // Print the row - echo ''; - echo '' . $field->name . ''; - echo '' . strtoupper($field->type) . ''; - echo '' . $field->max_length . ''; - echo ''; + // Print the row + echo ''; + echo '' . $field->name . ''; + echo '' . strtoupper($field->type) . ''; + echo '' . $field->max_length . ''; + echo ''; } echo ''; diff --git a/reference/mssql/functions/mssql-fetch-object.xml b/reference/mssql/functions/mssql-fetch-object.xml index a1f602e67b..db8fcc21d8 100644 --- a/reference/mssql/functions/mssql-fetch-object.xml +++ b/reference/mssql/functions/mssql-fetch-object.xml @@ -64,23 +64,19 @@ $query = mssql_query('SELECT [username], [name] FROM [php].[dbo].[userlist]'); // Check if there were any records -if(!mssql_num_rows($query)) -{ - echo 'No records found'; -} -else -{ - // Print a nice list of users in the format of: - // * name (username) +if (!mssql_num_rows($query)) { + echo 'No records found'; +} else { + // Print a nice list of users in the format of: + // * name (username) - echo '
    '; + echo '
      '; - while($row = mssql_fetch_object($query)) - { - echo '
    • ' . $row->name . ' (' . $row->username . ')
    • '; - } + while ($row = mssql_fetch_object($query)) { + echo '
    • ' . $row->name . ' (' . $row->username . ')
    • '; + } - echo '
    '; + echo '
'; } // Free the query result diff --git a/reference/mssql/functions/mssql-fetch-row.xml b/reference/mssql/functions/mssql-fetch-row.xml index 1a7b71ec96..22e9758423 100644 --- a/reference/mssql/functions/mssql-fetch-row.xml +++ b/reference/mssql/functions/mssql-fetch-row.xml @@ -58,7 +58,7 @@ '; // Dump all fields echo ''; -for($i = 0; $i < mssql_num_fields($query); ++$i) -{ - // Fetch the field information, notice the - // field_offset parameter is not set. See - // the mssql_field_seek call below - $field = mssql_fetch_field($query); +for ($i = 0; $i < mssql_num_fields($query); ++$i) { + // Fetch the field information, notice the + // field_offset parameter is not set. See + // the mssql_field_seek call below + $field = mssql_fetch_field($query); - // Print the row - echo ''; - echo '' . $field->name . ''; - echo '' . strtoupper($field->type) . ''; - echo '' . $field->max_length . ''; - echo ''; + // Print the row + echo ''; + echo '' . $field->name . ''; + echo '' . strtoupper($field->type) . ''; + echo '' . $field->max_length . ''; + echo ''; - // Move the internal seek pointer to the next - // row in the result set - mssql_field_seek($query, $i + 1); + // Move the internal seek pointer to the next + // row in the result set + mssql_field_seek($query, $i + 1); } echo ''; diff --git a/reference/mssql/functions/mssql-field-type.xml b/reference/mssql/functions/mssql-field-type.xml index c4c5c8f2b4..35c52a9ffb 100644 --- a/reference/mssql/functions/mssql-field-type.xml +++ b/reference/mssql/functions/mssql-field-type.xml @@ -59,7 +59,7 @@ ]]> diff --git a/reference/mssql/functions/mssql-init.xml b/reference/mssql/functions/mssql-init.xml index 4847b2c356..761889a57b 100644 --- a/reference/mssql/functions/mssql-init.xml +++ b/reference/mssql/functions/mssql-init.xml @@ -61,7 +61,7 @@ ]]> diff --git a/reference/mssql/functions/mssql-next-result.xml b/reference/mssql/functions/mssql-next-result.xml index b430773eb5..00bcf38d60 100644 --- a/reference/mssql/functions/mssql-next-result.xml +++ b/reference/mssql/functions/mssql-next-result.xml @@ -55,7 +55,7 @@ '; $header = false; // Iterate through returned results -while($row = mssql_fetch_array($data)) -{ - // Build the table header - if(!$header) - { - echo ''; - echo ''; +while ($row = mssql_fetch_array($data)) { + // Build the table header + if (!$header) { + echo ''; + echo ''; - for($i = 1; ($i + 1) <= mssql_num_fields($data); ++$i) - { - echo '' . ucfirst($row[$i]) . ''; - } + for ($i = 1; ($i + 1) <= mssql_num_fields($data); ++$i) { + echo '' . ucfirst($row[$i]) . ''; + } - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; - $header = true; - } + $header = true; + } - // Build the row - echo ''; + // Build the row + echo ''; - foreach($row as $value) - { - echo '' . $value . ''; - } + foreach($row as $value) { + echo '' . $value . ''; + } - echo ''; + echo ''; } // Close table diff --git a/reference/mssql/functions/mssql-pconnect.xml b/reference/mssql/functions/mssql-pconnect.xml index 81bcc0f647..e04f1ea8cb 100644 --- a/reference/mssql/functions/mssql-pconnect.xml +++ b/reference/mssql/functions/mssql-pconnect.xml @@ -99,7 +99,7 @@