dont work!

Discuss everything related to ApPHP DataForm. All versions. Any questions related to the ApPHP DataForm developing or using should be posted to this forum.

Moderator: alexandrleonenko

cocramtin
Newbie
Newbie
Posts: 5
Joined: Dec 21st, '12, 18:21

dont work!

Postby cocramtin » Dec 22nd, '12, 17:19

Help me please
I have postgresql 9.1, php 5.2, apache 2.2, dataform vers 339, windows 7 (64 bit).
I have enabled the exstensions for PDO and PDO for postgresql in the php.ini .
the path of my script (riprova.php) is: htdocs/PHPDF_339/riprova.php
I have started the script but... page blank.
What am I doing wrong?
i'im going crazy

administrator
Site Admin
Site Admin
Posts: 6010
Joined: Jan 7th, '09, 23:18
Contact:

Re: dont work!

Postby administrator » Dec 23rd, '12, 11:17

1. Check your server error log file to see what the error exactly you get
2. Debug DataSource() function to understand where exactly the code stops to work.

BTW, does it working with mysql or other drivers?

cocramtin
Newbie
Newbie
Posts: 5
Joined: Dec 21st, '12, 18:21

Re: dont work!

Postby cocramtin » Dec 23rd, '12, 13:59

this is the error.log of apache on starting:


[Sun Dec 23 14:54:56 2012] [error] [client 127.0.0.1] PHP Notice: Undefined variable: dform in C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\riprova.php on line 47
[Sun Dec 23 14:54:56 2012] [error] [client 127.0.0.1] PHP Fatal error: Call to a member function DataSource() on a non-object in C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\riprova.php on line 47
[Sun Dec 23 14:54:57 2012] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache Group/Apache2/htdocs/favicon.ico
[Sun Dec 23 14:54:57 2012] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache Group/Apache2/htdocs/favicon.ico

administrator
Site Admin
Site Admin
Posts: 6010
Joined: Jan 7th, '09, 23:18
Contact:

Re: dont work!

Postby administrator » Dec 24th, '12, 08:37

Undefined variable: dform in C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\riprova.php on line 47


means that you're trying to use object variable without create it.


You've missed a whole section:

## *** set needed options and create a new class instance
$debug_mode = false; /* display SQL statements while processing */
$messaging = true; /* display system messages on a screen */
$unique_prefix = 'abc_'; /* prevent overlays - must be started with a letter */
$dform = new DataForm($debug_mode, $messaging, $unique_prefix);

cocramtin
Newbie
Newbie
Posts: 5
Joined: Dec 21st, '12, 18:21

Re: dont work!

Postby cocramtin » Dec 25th, '12, 09:32

ok Let' s just start from the beginning
I started this (code_template.php modified):



and on starting the error log of apache is:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[Mon Dec 24 13:01:46 2012] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42704]: Undefined object: 7 ERROR: unrecognized configuration parameter "character_set_client"' in C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\dataform.class.php:1386\nStack trace:\n#0 C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\dataform.class.php(1386): PDO->query('SET character_s...')\n#1 C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\dataform.class.php(1329): DataForm->SetEncodingOnDatabase()\n#2 C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\dataform.class.php(948): DataForm->GetDataSet()\n#3 C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\riprova1.php(303): DataForm->Bind()\n#4 {main}\n thrown in C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\dataform.class.php on line 1386
[Mon Dec 24 13:01:46 2012] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache Group/Apache2/htdocs/favicon.ico
[Mon Dec 24 13:01:46 2012] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache Group/Apache2/htdocs/favicon.ico

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

administrator
Site Admin
Site Admin
Posts: 6010
Joined: Jan 7th, '09, 23:18
Contact:

Re: dont work!

Postby administrator » Dec 26th, '12, 07:59

1. Read this viewtopic.php?f=3&t=2
Don't post code directly! Use special tags or post just a small part of it.

2. Turn $this->forceEncodingOnDatabase = false;

cocramtin
Newbie
Newbie
Posts: 5
Joined: Dec 21st, '12, 18:21

Re: dont work!

Postby cocramtin » Dec 26th, '12, 09:19

//--------------------------------------------------------------------------
public function ForceDatabaseEncoding($force_encoding = true){
if($force_encoding == 'false' || $force_encoding === false){
$this->forceEncodingOnDatabase = false;
}
}


Dear administrator i excuse me for my errors but you must be patient with me because i am a newbie that speak english bad (I am italian).
if you refer at the portion of code of dataform.class.php above
it was already set on false.
However on the start i get a page blank again

administrator
Site Admin
Site Admin
Posts: 6010
Joined: Jan 7th, '09, 23:18
Contact:

Re: dont work!

Postby administrator » Dec 27th, '12, 09:28

Ok, you have to debug this function anyway, because the error says you have problems with this line of code:
$sql = 'SET '.$var.'='.$value;

Comment following lines of code at all:

Code: Select all

$sql = 'SET '.$var.'='.$value;
$this->dbHandler->query($sql);

cocramtin
Newbie
Newbie
Posts: 5
Joined: Dec 21st, '12, 18:21

Re: dont work!

Postby cocramtin » Dec 27th, '12, 10:21

nothing !!
the error log is:

[Thu Dec 27 11:05:49 2012] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42601]: Syntax error: 7 ERROR: LIMIT #,# syntax is not supported\nLINE 1: SELECT * FROM tabprova LIMIT 0, 1\n ^\nHINT: Use separate LIMIT and OFFSET clauses.' in C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\dataform.class.php:1331\nStack trace:\n#0 C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\dataform.class.php(1331): PDO->query('SELECT * FROM t...')\n#1 C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\dataform.class.php(948): DataForm->GetDataSet()\n#2 C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\riprova1.php(308): DataForm->Bind()\n#3 {main}\n thrown in C:\\Program Files (x86)\\Apache Group\\Apache2\\htdocs\\PHPDF_339\\dataform.class.php on line 1331

administrator
Site Admin
Site Admin
Posts: 6010
Joined: Jan 7th, '09, 23:18
Contact:

Re: dont work!

Postby administrator » Dec 30th, '12, 08:26

Try following:
- open dataform.class.php file, anf find SetSqlByDbType() method
- add following case in switch()

Code: Select all

            case 'pgsql':
                $sql_string = $sql.' '.$this->SetSqlLimitByDbType();
                break;


Does it help now?


Return to “ApPHP DataForm”