Conversion of some mysql php functions to oci functions.

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
amita
Regular
Posts: 29
Joined: Mon Jun 19, 2006 10:24 am

Post by amita »

Hi Garvin,

I tried by replacing the function,

its displaying as follows,

Code: Select all

Loading configuration for author ''

SELECT name, value
	                                        FROM serendipity_config
	                                        WHERE authorid = 0/ Result is: 

Final Result is: 
Array
(
    [GET] => 
    [POST] => 
    [COOKIE] => 
    [templatePath] => templates/
    [serendipityPath] => E:\Program Files\Apache Group\Apache2\htdocs\serendipity-1.0-beta3\serendipity/
    [indexFile] => index.php
    [version] => 1.0-beta3
    [defaultTemplate] => carl_contest
    [production] => 
    [rewrite] => none
    [messagestack] => Array
        (
        )

    [allowDateManipulation] => 1
    [max_last_modified] => 12960000
    [max_fetch_limit] => 50
    [trackback_filelimit] => 153600
    [fetchLimit] => 15
    [use_PEAR] => 
    [use_iframe] => 1
    [autolang] => en
    [languages] => Array
        (
            [en] => English
            [de] => German
            [da] => Danish
            [es] => Spanish
            [fr] => French
            [fi] => Finnish
            [cs] => Czech (Win-1250)
            [cz] => Czech (ISO-8859-2)
            [nl] => Dutch
            [is] => Icelandic
            [tr] => Turkish
            [se] => Swedish
            [pt] => Portuguese Brazilian
            [pt_PT] => Portuguese European
            [bg] => Bulgarian
            [hu] => Hungarian
            [no] => Norwegian
            [ro] => Romanian
            [it] => Italian
            [ru] => Russian
            [fa] => Persian
            [tw] => Traditional Chinese (Big5)
            [tn] => Traditional Chinese (UTF-8)
            [zh] => Simplified Chinese (GB2312)
            [cn] => Simplified Chinese (UTF-8)
            [ja] => Japanese
            [ko] => Korean
            [ta] => Tamil
        )

    [calendars] => Array
        (
            [gregorian] => Gregorian
            [jalali-utf8] => Jalali (utf8)
        )

    [charsets] => Array
        (
            [UTF-8/] => UTF-8
            [] => CHARSET_NATIVE
        )

    [versionInstalled] => 1.0-beta3
    [dbName] => serendipity
    [dbPrefix] => serendipity_
    [dbHost] => serendipity
    [dbUser] => scott
    [dbPass] => tiger
    [dbType] => oci8
    [dbPersistent] => 
    [imageList] => Array
        (
        )

    [dbConn] => Resource id #19
)
Even i tried putting echo statements in function serendipity_userLoggedIn,
as follows:

Code: Select all

function serendipity_userLoggedIn() {
    if ($_SESSION['serendipityAuthedUser'] === true && IS_installed) {
    echo "user logged in";
        return true;
    } else {
    echo "user not logged in";
        return false;
    }
}
its displaying me as "user not Logged in" .

Is that connection is closed or its not retriving data from the table again?

Thanks,
Amita
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

You got it in front:
SELECT name, value
FROM serendipity_config
WHERE authorid = 0
This query does not yield any results! But it should return all rows of the table. Check the same changed function in your MySQL s9y installation and then you see how the rows should be returned.

Maybe your serendipity_db_query() function does not work at all. Check it out in MySQL to see how it's supposed to work and return rows.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
amita
Regular
Posts: 29
Joined: Mon Jun 19, 2006 10:24 am

Post by amita »

Hi Garvin,

I chnaged the serendipity_db_query function. I just created a samll dummy program to create table, insert rows, select rows etc. its working fine. so i just added those functionality in current Serendipity_db_query()

Code: Select all

   global $serendipity;
    static $type_map = array(
                         'assoc' => OCI_ASSOC,
                         'num'   => OCI_NUM,
                         'both'  => OCI_BOTH,
                         'true'  => true,
                         'false' => false
    );

    if ($expectError) {
       $c = OCIParse($serendipity['dbConn'] , $sql);
       if(!$c) {
          if (!$expectError && !$serendipity['production']) {
               print '<pre>' . $sql . '</pre> / ' . OCIError($serendipity['dbConn']);
	 if (function_exists('debug_backtrace') && $reportErr == true)   {
		          highlight_string(var_export(debug_backtrace(), 1));
            }
             return $type_map['false'];
			    }

   	      echo "<h1>ERROR - Could not parse SQL statement.</h1>";
   	      exit;
         }
	   OCIExecute($c, OCI_DEFAULT);
    }else {
        $c = OCIParse($serendipity['dbConn'] , $sql);
        if(!$c) {
           if (!$expectError && !$serendipity['production']) {
				      print '<pre>' . $sql . '</pre> / ' . OCIError($serendipity['dbConn']);
				      if (function_exists('debug_backtrace') && $reportErr == true) {
				          highlight_string(var_export(debug_backtrace(), 1));
		            }
		    return $type_map['false'];
			 }

	      echo "<h1>ERROR - Could not parse SQL statement.</h1>";
	      exit;
          }
        OCIExecute($c, OCI_DEFAULT);
    }

    if (!$expectError && OCIError($serendipity['dbConn']) != '') {
        $msg = '<pre>' . $sql . '</pre> / ' . OCIError($serendipity['dbConn']);
        return $msg;
    }

    if ($c == true) {
        return $type_map['true'];
    }

    $result_type = $type_map[$result_type];

    switch(OCIRowCount($c)) {
        case 0:
            if ($single) {
                echo "Case 0";
                return $type_map['false'];
            }
            return $type_map['true'];
        case 1:
            if ($single) {
                echo "Case 1";
                return OCIFetchStatement($c, $result_type);

            }
        default:
            if ($single) {
                echo "Case default";
                return OCIFetchStatement($c, $result_type);
            }

            $rows = array();
            while (($row = OCIFetchStatement($c, $result_type))) {
                if (!empty($assocKey) && !empty($assocVal)) {
                    // You can fetch a key-associated array via the two function parameters assocKey and assocVal
                    $rows[$row[$assocKey]] = $row[$assocVal];
                } else {
                    $rows[] = $row;
                }
            }
            return $rows;
    }
And again i tried to install serendipity. Now it is giving me the results as follows:

Code: Select all

Loading configuration for author ''1
Result is: 
1
Final Result is: 
Array
(
    [GET] => 
    [POST] => 
    [COOKIE] => 
    [templatePath] => templates/
    [serendipityPath] => E:\Program Files\Apache Group\Apache2\htdocs\serendipity-1.0-beta3\serendipity/
    [indexFile] => index.php
    [version] => 1.0-beta3
    [defaultTemplate] => carl_contest
    [production] => 
    [rewrite] => none
    [messagestack] => Array
        (
        )

    [allowDateManipulation] => 1
    [max_last_modified] => 12960000
    [max_fetch_limit] => 50
    [trackback_filelimit] => 153600
    [fetchLimit] => 15
    [use_PEAR] => 
    [use_iframe] => 1
    [autolang] => en
    [languages] => Array
        (
            [en] => English
            [de] => German
            [da] => Danish
            [es] => Spanish
            [fr] => French
            [fi] => Finnish
            [cs] => Czech (Win-1250)
            [cz] => Czech (ISO-8859-2)
            [nl] => Dutch
            [is] => Icelandic
            [tr] => Turkish
            [se] => Swedish
            [pt] => Portuguese Brazilian
            [pt_PT] => Portuguese European
            [bg] => Bulgarian
            [hu] => Hungarian
            [no] => Norwegian
            [ro] => Romanian
            [it] => Italian
            [ru] => Russian
            [fa] => Persian
            [tw] => Traditional Chinese (Big5)
            [tn] => Traditional Chinese (UTF-8)
            [zh] => Simplified Chinese (GB2312)
            [cn] => Simplified Chinese (UTF-8)
            [ja] => Japanese
            [ko] => Korean
            [ta] => Tamil
        )

    [calendars] => Array
        (
            [gregorian] => Gregorian
            [jalali-utf8] => Jalali (utf8)
        )

    [charsets] => Array
        (
            [UTF-8/] => UTF-8
            [] => CHARSET_NATIVE
        )

    [versionInstalled] => 1.0-beta3
    [dbName] => serendipity
    [dbPrefix] => serendipity_
    [dbHost] => serendipity
    [dbUser] => scott
    [dbPass] => tiger
    [dbType] => oci8
    [dbPersistent] => 
    [imageList] => Array
        (
        )

    [dbConn] => Resource id #19
)
What may be the problem in Serendipity_db_query() function? All the values are getting inserted into the oracle database.

Please guide me to get out of this problem....

Thanks,
Amita
amita
Regular
Posts: 29
Joined: Mon Jun 19, 2006 10:24 am

Post by amita »

Hi Garvin,

I checked with the mysql output also for the same page....

Its showing the whole Arrays... the whole data from serendipity_config table is displayed as an output....

why it is not displaying it to me... ?

I think i m disturbing you a lot... but i cant help...as u r the only source of help for me... :)

Thanks,
Amita
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
Its showing the whole Arrays... the whole data from serendipity_config table is displayed as an output....
Exactly, that is the desired output!
why it is not displaying it to me... ?
Because it seems that your serendipity_db_query does not properly return an array. ;)

I'm sorry, I don't have any Oracle expierence, so I cannot tell you what to use to get the same results as with pgsql, mysql or sqlite. Maybe Falk can help here?


Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
amita
Regular
Posts: 29
Joined: Mon Jun 19, 2006 10:24 am

Post by amita »

Hi Garvin,

We observed different RETURN types in serendipity_db_query() like 'assoc' => OCI_ASSOC,'num' => OCI_NUM,'both' => OCI_BOTH,'true' => true,'false' => false. It shows that any of these types will be returned. But we never observed any code for checking the type of the value returned by serendipity_db_query() in the calling function/program. Then what is the significance of having these many return types ?

Again,
As per the definition of serendipity_db_query(),

Code: Select all

serendipity_db_query(
$sql, 
$single = false, 
$result_type = "both", 
$reportErr = false, 
$assocKey = false, 
$assocVal = false, 
$expectError = false)
, there are different input params which were defaulted to standard values. Can you describe the use of $single, $result_type.

Thanks in advance,
Amita.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

The wanted return code is passed as the 3rd. argument to serendipity_db_query.

Most db queries use "both" as the result type (which yields arrays like $serendipity[0] = 'x', $serendpity['column'] = 'x').

"assoc" only returns textual associations ('column1', 'column2', ...) whereas "num" only returns 0, 1, 2... etc.

Please check the PHPDoc code commentare inside the mysql files to see what $single / $result_type etc. indicates.

The best way for you would be to execute different function calls in your mysql install and see the differents. Like execute "SELECT * FROM serendipity_config" like this:

Code: Select all

print_r(serendipity_db_query("SELECT * FROM serendipity_config"));
print_r(serendipity_db_query("SELECT * FROM serendipity_config", false, 'num'));
print_r(serendipity_db_query("SELECT * FROM serendipity_config", false, 'assoc'));

print_r(serendipity_db_query("SELECT * FROM serendipity_config", true));
print_r(serendipity_db_query("SELECT * FROM serendipity_config", true, 'num'));
print_r(serendipity_db_query("SELECT * FROM serendipity_config", true, 'assoc'));
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
amita
Regular
Posts: 29
Joined: Mon Jun 19, 2006 10:24 am

Post by amita »

Hi Garvin,

Thanks for your quick and eloborated explanation. Good news is that, we crossed that point and getting the proper return type(s) from serendipity_db_query(). The below is the value of $serendipity array of PHP which has the values of serendipity_config table.

Code: Select all

Loading configuration for author ''
Result is: 
Array
(
    [NAME] => Array
        (
            [0] => serendipityHTTPPath
            [1] => templatePath
            [2] => uploadHTTPPath
            [3] => baseURL
            [4] => autodetect_baseURL
            [5] => indexFile
            [6] => permalinkStructure
            [7] => permalinkAuthorStructure
            [8] => permalinkCategoryStructure
            [9] => permalinkFeedCategoryStructure
            [10] => permalinkFeedAuthorStructure
            [11] => permalinkArchivesPath
            [12] => permalinkArchivePath
            [13] => permalinkCategoriesPath
            [14] => permalinkAuthorsPath
            [15] => permalinkUnsubscribePath
            [16] => permalinkDeletePath
            [17] => permalinkApprovePath
            [18] => permalinkFeedsPath
            [19] => permalinkPluginPath
            [20] => permalinkAdminPath
            [21] => permalinkSearchPath
            [22] => allowSubscriptions
            [23] => blogTitle
            [24] => blogDescription
            [25] => blogMail
            [26] => lang
            [27] => charset
            [28] => calendar
            [29] => lang_content_negotiation
            [30] => fetchLimit
            [31] => useGzip
            [32] => wysiwyg
            [33] => XHTML11
            [34] => enablePopup
            [35] => embed
            [36] => top_as_links
            [37] => trackReferrer
            [38] => blockReferer
            [39] => rewrite
            [40] => serverOffsetHours
            [41] => showFutureEntries
            [42] => enableACL
            [43] => magick
            [44] => convert
            [45] => thumbSuffix
            [46] => thumbSize
            [47] => template
            [48] => serendipityPath
            [49] => uploadPath
        )

    [VALUE] => Array
        (
            [0] => /serendipity-1.0-beta3/serendipity/
            [1] => templates/
            [2] => uploads/
            [3] => http://localhost/serendipity-1.0-beta3/serendipity/
            [4] => 
            [5] => index.php
            [6] => archives/%id%-%title%.html
            [7] => authors/%id%-%realname%
            [8] => categories/%id%-%name%
            [9] => feeds/categories/%id%-%name%.rss
            [10] => feeds/authors/%id%-%realname%.rss
            [11] => archives
            [12] => archive
            [13] => categories
            [14] => authors
            [15] => unsubscribe
            [16] => delete
            [17] => approve
            [18] => feeds
            [19] => plugin
            [20] => admin
            [21] => search
            [22] => 1
            [23] => John Does personal blog
            [24] => My little place on the web...
            [25] => 
            [26] => en
            [27] => UTF-8/
            [28] => gregorian
            [29] => 
            [30] => 15
            [31] => 
            [32] => false
            [33] => 1
            [34] => 
            [35] => false
            [36] => 
            [37] => 1
            [38] => ;
            [39] => none
            [40] => 0
            [41] => 
            [42] => 1
            [43] => 
            [44] => C:\\WINDOWS\\system32/convert.exe
            [45] => serendipityThumb
            [46] => 110
            [47] => carl_contest
            [48] => E:/Program Files/Apache Group/Apache2/htdocs/serendipity-1.0-beta3/serendipity/
            [49] => uploads/
        )

)

Final Result is: 
Array
(
    [GET] => 
    [POST] => 
    [COOKIE] => 
    [templatePath] => templates/
    [serendipityPath] => E:\Program Files\Apache Group\Apache2\htdocs\serendipity-1.0-beta3\serendipity/
    [indexFile] => index.php
    [version] => 1.0-beta3
    [defaultTemplate] => carl_contest
    [production] => 
    [rewrite] => none
    [messagestack] => Array
        (
        )

    [allowDateManipulation] => 1
    [max_last_modified] => 12960000
    [max_fetch_limit] => 50
    [trackback_filelimit] => 153600
    [fetchLimit] => 15
    [use_PEAR] => 
    [use_iframe] => 1
    [autolang] => en
    [languages] => Array
        (
            [en] => English
            [de] => German
            [da] => Danish
            [es] => Spanish
            [fr] => French
            [fi] => Finnish
            [cs] => Czech (Win-1250)
            [cz] => Czech (ISO-8859-2)
            [nl] => Dutch
            [is] => Icelandic
            [tr] => Turkish
            [se] => Swedish
            [pt] => Portuguese Brazilian
            [pt_PT] => Portuguese European
            [bg] => Bulgarian
            [hu] => Hungarian
            [no] => Norwegian
            [ro] => Romanian
            [it] => Italian
            [ru] => Russian
            [fa] => Persian
            [tw] => Traditional Chinese (Big5)
            [tn] => Traditional Chinese (UTF-8)
            [zh] => Simplified Chinese (GB2312)
            [cn] => Simplified Chinese (UTF-8)
            [ja] => Japanese
            [ko] => Korean
            [ta] => Tamil
        )

    [calendars] => Array
        (
            [gregorian] => Gregorian
            [jalali-utf8] => Jalali (utf8)
        )

    [charsets] => Array
        (
            [UTF-8/] => UTF-8
            [] => CHARSET_NATIVE
        )

    [versionInstalled] => 1.0-beta3
    [dbName] => serendipity
    [dbPrefix] => serendipity_
    [dbHost] => serendipity
    [dbUser] => scott
    [dbPass] => tiger
    [dbType] => oci8
    [dbPersistent] => 
    [imageList] => Array
        (
        )

    [dbConn] => Resource id #19
    [0] => Array
        (
            [0] => serendipityHTTPPath
            [1] => /serendipity-1.0-beta3/serendipity/
        )

    [1] => Array
        (
            [0] => templatePath
            [1] => templates/
        )

    [2] => Array
        (
            [0] => uploadHTTPPath
            [1] => uploads/
        )

    [3] => Array
        (
            [0] => baseURL
            [1] => http://localhost/serendipity-1.0-beta3/serendipity/
        )

    [4] => Array
        (
            [0] => autodetect_baseURL
            [1] => 
        )

    [5] => Array
        (
            [0] => indexFile
            [1] => index.php
        )

    [6] => Array
        (
            [0] => permalinkStructure
            [1] => archives/%id%-%title%.html
        )

    [7] => Array
        (
            [0] => permalinkAuthorStructure
            [1] => authors/%id%-%realname%
        )

    [8] => Array
        (
            [0] => permalinkCategoryStructure
            [1] => categories/%id%-%name%
        )

    [9] => Array
        (
            [0] => permalinkFeedCategoryStructure
            [1] => feeds/categories/%id%-%name%.rss
        )

    [10] => Array
        (
            [0] => permalinkFeedAuthorStructure
            [1] => feeds/authors/%id%-%realname%.rss
        )

    [11] => Array
        (
            [0] => permalinkArchivesPath
            [1] => archives
        )

    [12] => Array
        (
            [0] => permalinkArchivePath
            [1] => archive
        )

    [13] => Array
        (
            [0] => permalinkCategoriesPath
            [1] => categories
        )

    [14] => Array
        (
            [0] => permalinkAuthorsPath
            [1] => authors
        )

    [15] => Array
        (
            [0] => permalinkUnsubscribePath
            [1] => unsubscribe
        )

    [16] => Array
        (
            [0] => permalinkDeletePath
            [1] => delete
        )

    [17] => Array
        (
            [0] => permalinkApprovePath
            [1] => approve
        )

    [18] => Array
        (
            [0] => permalinkFeedsPath
            [1] => feeds
        )

    [19] => Array
        (
            [0] => permalinkPluginPath
            [1] => plugin
        )

    [20] => Array
        (
            [0] => permalinkAdminPath
            [1] => admin
        )

    [21] => Array
        (
            [0] => permalinkSearchPath
            [1] => search
        )

    [22] => Array
        (
            [0] => allowSubscriptions
            [1] => 1
        )

    [23] => Array
        (
            [0] => blogTitle
            [1] => John Does personal blog
        )

    [24] => Array
        (
            [0] => blogDescription
            [1] => My little place on the web...
        )

    [25] => Array
        (
            [0] => blogMail
            [1] => 
        )

    [26] => Array
        (
            [0] => lang
            [1] => en
        )

    [27] => Array
        (
            [0] => charset
            [1] => UTF-8/
        )

    [28] => Array
        (
            [0] => calendar
            [1] => gregorian
        )

    [29] => Array
        (
            [0] => lang_content_negotiation
            [1] => 
        )

    [30] => Array
        (
            [0] => fetchLimit
            [1] => 15
        )

    [31] => Array
        (
            [0] => useGzip
            [1] => 
        )

    [32] => Array
        (
            [0] => wysiwyg
            [1] => 
        )

    [33] => Array
        (
            [0] => XHTML11
            [1] => 1
        )

    [34] => Array
        (
            [0] => enablePopup
            [1] => 
        )

    [35] => Array
        (
            [0] => embed
            [1] => 
        )

    [36] => Array
        (
            [0] => top_as_links
            [1] => 
        )

    [37] => Array
        (
            [0] => trackReferrer
            [1] => 1
        )

    [38] => Array
        (
            [0] => blockReferer
            [1] => ;
        )

    [39] => Array
        (
            [0] => rewrite
            [1] => none
        )

    [40] => Array
        (
            [0] => serverOffsetHours
            [1] => 0
        )

    [41] => Array
        (
            [0] => showFutureEntries
            [1] => 
        )

    [42] => Array
        (
            [0] => enableACL
            [1] => 1
        )

    [43] => Array
        (
            [0] => magick
            [1] => 
        )

    [44] => Array
        (
            [0] => convert
            [1] => C:\\WINDOWS\\system32/convert.exe
        )

    [45] => Array
        (
            [0] => thumbSuffix
            [1] => serendipityThumb
        )

    [46] => Array
        (
            [0] => thumbSize
            [1] => 110
        )

    [47] => Array
        (
            [0] => template
            [1] => carl_contest
        )

    [48] => Array
        (
            [0] => serendipityPath
            [1] => E:/Program Files/Apache Group/Apache2/htdocs/serendipity-1.0-beta3/serendipity/
        )

    [49] => Array
        (
            [0] => uploadPath
            [1] => uploads/
        )

)

The above values are in sink with the MySql values.

The point where we struck now is:-
We are getting a blank page at the 4th stage of installation, where we should get a personal bolg page containing some plug-ins like Calendar and other stuff.

We would like to know basing on which parameters the plug-ins will be decided and added to the bolg page ?

Can I dare to ask your contact number to get clarified with my queries in quick time :) ? [ if you dont mind on that. ]

Thanks in advance,
Amita.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Please check your output! MySQL results are different, they do not have the multiple associative arrays you got with your Oracle results.

Instead of:

Code: Select all

    [30] => Array
        (
            [0] => fetchLimit
            [1] => 15
        )
on mysql this looks like:

Code: Select all

    [fetchlimt] => 15
Thus, serendipity is getting values different from what it expects!

My ICQ number should be in my footer: #21392242.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
amita
Regular
Posts: 29
Joined: Mon Jun 19, 2006 10:24 am

Post by amita »

Hi Garvin,

We made the array to display in the same format as what mysql displays..

And the exciting thing is we are getting the blog page.... with "John Doe Personel blog" as header. But the control on right hand side of the page are not displayed.

we are getting,

Code: Select all

 
 Error
serendipity error: could not include - exiting.
Error
serendipity error: could not include - exiting.
 
this error instead of the controls as calendar, RSS Feed, quick search etc.

i think ... now we are very close to it... :)

But why the controls are not displayed??

Please provide me the proper guideline in this regard....

Thanks,
Amita
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

It seems like there still are some wrong DB formats for this error.

Check your include/plugin_api.inc.php file. There go to the method "generate_plugins".

There, compare the output of $plugins inside the method with the output of $plugins on your mysql installation.

The error message is created a little bit more down the method:

Code: Select all

'content'       => sprintf(INCLUDE_ERROR, $plugin_data['name']));
This means that $plugin_data['name'] is empty on your installation, but in reality it should hold the classname of the plugin. Plus, you surely are missing other important $plugin_data array values which is why loading the plugins fails!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
amita
Regular
Posts: 29
Joined: Mon Jun 19, 2006 10:24 am

Post by amita »

Hi Garvin,

We are back with the new query here!!! :)

What does the autoincrement field works in mysql? In more words,
01. For which fields of which tables it should be incremented ?
02. For which fields of which tables it should get the latest value ?

We wrote different sequences in Oracle for all the tables for which we found AUTOINCREMENT keyword in MySql code. Is it ok ??

Please suggest.

Thanks in advance,
Amita.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
We are back with the new query here!!! :)
:) I hope you remember me when you got it all up and running, because I'd love to put your work and the oracle interface into Serendipity. :)
What does the autoincrement field works in mysql? In more words,
01. For which fields of which tables it should be incremented ?
02. For which fields of which tables it should get the latest value ?
The autincrement field automatically inserts primary keys for the tables for new records. This way, the first entry gets ID 1, the second ID 2 and so on - each time a new record is inserted, it will automatically be set to the ID of the next free integer number.

The fields that need auto-increment can be found in the db.sql file, {AUTOINCREMENT} is attached to thos.
We wrote different sequences in Oracle for all the tables for which we found AUTOINCREMENT keyword in MySql code. Is it ok ??
That should be sufficient, even though I am personally not familiar with the concept of sequeneces, because basically mysql handles them internally.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
amita
Regular
Posts: 29
Joined: Mon Jun 19, 2006 10:24 am

Post by amita »

Hi Garvin,

I have little bit different query....

I will give u an example.

In Mysql, the "Authorid" field in serendipity_authors is AutoIncrement field.
But there is "AuthorID" field in serendipity_authorgroups, serendipity_category, serendipity_config , serendipity_entries, etc.

The value of "AuthorID" gets populated by autoincrement in serendipity_authors , but how it gets inserted in different tables.
For me all different tables entries for Authorid are empty.

so , it is giving me problem while fetching entry record for "Edit Entry" and "Create new category".

Please suggest me ...

Thanks,
Amita
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
In Mysql, the "Authorid" field in serendipity_authors is AutoIncrement field.
But there is "AuthorID" field in serendipity_authorgroups, serendipity_category, serendipity_config , serendipity_entries, etc.
Yes, that's a usual 1:n association of one primary key to related foreign keys.
The value of "AuthorID" gets populated by autoincrement in serendipity_authors , but how it gets inserted in different tables.
For me all different tables entries for Authorid are empty.
Serendipity retrieves the ID of the last inserted entry via the "serendipity_db_insert_id()" function. On MySQL, this executes the "SELECT LAST_INSERT_ID()" function, which will return the ID of the last inserted primary key. s9y uses this return value to insert corresponding foreign keys into the other tables.

So, by default s9y would create a new author in serendipity_authors, then retriev the author ID via this db_insert_id() function and then INSERT the correponsding ID into the serendipity_authorgroups or other tables.

The same for entry creation: The last insert ID is returned and then used for follow-up functions.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply