Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

cvs: phpdoc /en/reference/ibase/functions ibase-blob-import.xml ibase-execute.xml
didou		Sat Oct 30 11:57:33 2004 EDT

Modified files:
/phpdoc/en/reference/ibase/functions	ibase-blob-import.xml
ibase-execute.xml
Log:
CS and add a check on the file pointer
# I was going to fix #22871 but it was already done :)

http://cvs.php.net/diff.php/phpdoc/...1.6&r2=1.7&ty=u
Index: phpdoc/en/reference/ibase/functions/ibase-blob-import.xml
diff -u phpdoc/en/reference/ibase/functions/ibase-blob-import.xml:1.6 phpdoc
/en/reference/ibase/functions/ibase-blob-import.xml:1.7
--- phpdoc/en/reference/ibase/functions/ibase-blob-import.xml:1.6	Wed Sep 22
 04:55:45 2004
+++ phpdoc/en/reference/ibase/functions/ibase-blob-import.xml	Sat Oct 30 11:
57:32 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/ibase.xml, last change in rev 1.39 -->
<refentry id='function.ibase-blob-import'>
<refnamediv>
@@ -34,17 +34,22 @@
$filename = '/tmp/bar';

$fd = fopen($filename, 'r');
-$blob = ibase_blob_import($dbh, $fd);
-fclose($fd);
+if ($fd) {

-if (!is_string($blob)) {
-    // import failed
-} else {
-    $query = "INSERT INTO foo (name, data) VALUES ('$filename', ?)";
-    $prepared = ibase_prepare($dbh, $query);
-    if (!ibase_execute($prepared, $blob)) {
-        // record insertion failed
+    $blob = ibase_blob_import($dbh, $fd);
+    fclose($fd);
+
+    if (!is_string($blob)) {
+        // import failed
+    } else {
+        $query = "INSERT INTO foo (name, data) VALUES ('$filename', ?)";
+        $prepared = ibase_prepare($dbh, $query);
+        if (!ibase_execute($prepared, $blob)) {
+            // record insertion failed
+        }
}
+} else {
+    // unable to open the data file
}
?>
]]>
http://cvs.php.net/diff.php/phpdoc/...1.8&r2=1.9&ty=u
Index: phpdoc/en/reference/ibase/functions/ibase-execute.xml
diff -u phpdoc/en/reference/ibase/functions/ibase-execute.xml:1.8 phpdoc/en/
reference/ibase/functions/ibase-execute.xml:1.9
--- phpdoc/en/reference/ibase/functions/ibase-execute.xml:1.8	Wed Sep 22 04:
42:45 2004
+++ phpdoc/en/reference/ibase/functions/ibase-execute.xml	Sat Oct 30 11:57:3
2 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/ibase.xml, last change in rev 1.2 -->
<refentry id="function.ibase-execute">
<refnamediv>
@@ -33,19 +33,20 @@
<![CDATA[
<?php

-    $dbh = ibase_connect($host, $username, $password);
+$dbh = ibase_connect($host, $username, $password);

-    $updates = array(
-        1 => 'Eric',
-        5 => 'Filip',
-        7 => 'Larry'
-    );
+$updates = array(
+    1 => 'Eric',
+    5 => 'Filip',
+    7 => 'Larry'
+);

-    $query = ibase_prepare($dbh, "UPDATE FOO SET BAR = ? WHERE BAZ = ?");
+$query = ibase_prepare($dbh, "UPDATE FOO SET BAR = ? WHERE BAZ = ?");
+
+while (list($baz, $bar) = each($updates)) {
+    ibase_execute($query, $bar, $baz);
+}

-    while (list($baz, $bar) = each($updates)) {
-        ibase_execute($query, $bar, $baz);
-    }
?>
]]>
</programlisting>

Report this thread to moderator Post Follow-up to this message
Old Post
Mehdi Achour
10-30-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Documentation archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:22 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.