Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.
I encountered a problem during install.
1. i input parameter on first page and submit.
2. out put "Database 'projectorria' created. Parameters are saved.".
3. web redirect to /view/main.php.
4. blank page...
I tried to fix it but without success.
I encountered the following problem.
1. database create success but not have any table.
2. in php logs i found..
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP Fatal error: Call to a member function query() on a non-object in D:\Web\web.com\pmi\model\persistence\Sql.php on line 58, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP Stack trace:, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP 1. {main}() D:\Web\web.com\pmi\view\main.php:0, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP 2. require_once() D:\Web\web.com\pmi\view\main.php:10, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP 3. include() D:\Web\web.com\pmi\tool\projector.php:121, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP 4. Parameter::getGlobalParameter() D:\Web\web.com\pmi\view\login.php:24, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP 5. SqlElement->getSqlElementsFromCriteria() D:\Web\web.com\pmi\model\Parameter.php:471, referer: ...
[Sat Mar 23 18:46:48.816944 2013] [:error] [pid 5668:tid 1044] [client 127.0.0.1:27819] PHP 6. Sql::query() D:\Web\web.com\pmi\model\persistence\SqlElement.php:1163, referer: ...
please help me.
thank!
First, it is normal that database is empty.
It will be updated on first connection.
Then the issue you get.
Your log reports an issue on line 1163 of /model/persistence/SqlElement.php.
Line code is code type=php] $result = Sql::query($query);
There is not reason to get an error there.
Sql is a class, and query is called as a static method.
Which version of PHP do you run ?
Thank for Reply :cheer: .
MyServer:
php - 5.4.11
apache - 2.4.3 (Win32)
mysql - 5.6.10
it is error in "model/persistence/Sql.php" on line 58
56 try {
57 $startMicroTime=microtime(true);
58 $result = $cnx->query($sqlRequest);
59 if (isset($debugQuery) and $debugQuery) {
60 // debugLog to keep
61 debugLog(round((microtime(true) - $startMicroTime)*1000000)/1000000 . ";" . $sqlRequest);
62 }
i install projectorriaV3.2.1.
Do you have PDO installed ?
yes. I install already.
in my php.ini
extension=php_pdo_mysql.dll
Is it possible that the version of php or apache not Incongruous?
It looks like you cannot get a connection.
Can you add a var_dump for connection on Sql.php, line 244. It should look like :
try {
$dsn = self::$dbType.':host='.self::$dbHost.';dbname='.self::$dbName;
self::$connexion = new PDO($dsn, self::$dbUser, self::$dbPassword);
var_dump(self::$connexion);
self::$connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (PDOException $e) {
echo htmlGetErrorMessage($e->getMessage( )).'
';
}
and report here displayed content.
I think it error before var_dump().
This is a Full HTML code in page.
Project'Or RIA <script type="text/javascript" src="../external/dojo/dojo.js" djConfig='modulePaths: {i18n: "../../tool/i18n"}, parseOnLoad: true, isDebug:
( ! ) Fatal error: Call to a member function query() on a non-object in D:Webweb.compmimodelpersistenceSql.php on line 58 Call Stack # Time Memory Function Location 1 0.0016 397824 {main}( ) ..main.php:0 2 0.0047 664264 require_once( 'D:Webweb.compmitoolprojector.php' ) ..main.php:10 3 0.0280 1679096 include( 'D:Webweb.compmiviewlogin.php' ) ..projector.php:121 4 0.0286 1679408 Parameter::getGlobalParameter( ) ..login.php:24 5 0.0287 1681048 SqlElement->getSqlElementsFromCriteria( ) ..Parameter.php:471 6 0.0296 1739592 Sql::query( ) ..SqlElement.php:1163
OK i can FIX it! :woohoo:
Insert Port in to Line 219
217 if (!self::$dbType or !self::$dbHost or !self::$dbName) {
218 self::$dbType=Parameter::getGlobalParameter('paramDbType');
219 self::$dbHost=Parameter::getGlobalParameter('paramDbHost').':'.Parameter::getGlobalParameter('paramDbPort');
220 self::$dbUser=Parameter::getGlobalParameter('paramDbUser');
221 self::$dbPassword=Parameter::getGlobalParameter('paramDbPassword');
222 self::$dbName=Parameter::getGlobalParameter('paramDbName');
223 }
Thank you so much 😆
You're right !
Code only worked for default port (3306).
I'll include this fix in next version.
Thanks for your contribution.
Hi,
Your patch doesn't work.
The DSN is not corretly set.
I suggest :
class Sql {
[...]
private static $dbPort;
[...]
private static function getConnection() {
[...]
if (isset($paramDbPort) and $paramDbPort) { self::$dbPort = $paramDbPort; }
[...]
$dsn = self::$dbType.':host='.self::$dbHost.';port='.self::$dbPort.';dbname='.self::$dbName;
[...]
It is this syntax for DSN that is implement in V3.2.2.
Did you test it ?
Yes, in 3.2.2, the code is :
220 if (isset($paramDbPort) and $paramDbPort) { self::$dbHost.=':'.$paramDbPort; }
244 $dsn = self::$dbType.':host='.self::$dbHost.';dbname='.self::$dbName;
DSN must be : type:host=xxx;port=xxx;dbname=xxx
If you chained the host and port with ":" it doesn't work.
It seems you downloaded V3.2.2 in the first hours of monday 25th.
There is a message in the news about this point : due to deployment issue, pleased re-dwnload V3.2.2 if you first downloaded it on monday 25th before 3 PM GMT.
Correct version sets :
try {
$dsn = self::$dbType.':host='.self::$dbHost.';port='.self::$dbPort.';dbname='.self::$dbName;
self::$connexion = new PDO($dsn, self::$dbUser, self::$dbPassword);
self::$connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
Exact ! 😛
Problem solved 😉