PrimeBase and PHP Module Compiling Issue -
12-12-2006
, 05:04 PM
Hi:
I have downloaded the PrimeBase PHP Module but when I tried to compile
it on the Microsoft Visual Studio 6, it shows me the following errors:
Compiling...
primebase.c
C:\php-4.3.2\ext\primebase\primebase.c(798) : error C2065:
'primebase_globals' : undeclared identifier
C:\php-4.3.2\ext\primebase\primebase.c(798) : error C2223: left of
'->auto_extract' must point to struct/union
C:\php-4.3.2\ext\primebase\primebase.c(1030) : warning C4244: '=' :
conversion from 'long ' to 'unsigned char ', possible loss of data
C:\php-4.3.2\ext\primebase\primebase.c(1134) : warning C4244: '=' :
conversion from 'long ' to 'unsigned char ', possible loss of data
C:\php-4.3.2\ext\primebase\primebase.c(3728) : warning C4244: '=' :
conversion from 'long ' to 'unsigned char ', possible loss of data
C:\php-4.3.2\ext\primebase\primebase.c(3765) : warning C4244: '=' :
conversion from 'long ' to 'unsigned char ', possible loss of data
C:\php-4.3.2\ext\primebase\primebase.c(4314) : warning C4018: '<' :
signed/unsigned mismatch
Error executing cl.exe.
Creating browse info file...
Then, I searched the erros within the code , and it shows me this part
of it:
static Bool init_connection(unsigned long session_id)
{
char cmd[80];
sprintf(cmd,"PBCTL 13 = %d;\n",PB_G(auto_extract));
if (PBIExecute(session_id, cmd, PB_NTS, PB_EXECUTE_NOW, NULL, NULL,
NULL) != PB_OK)
return 0;
else
return 1;
}
and the error is within this line
sprintf(cmd,"PBCTL 13 = %d;\n",PB_G(auto_extract));
I have configured all the corresponding include directories and the
libraries, compile it and nothing.
So what I decided to do was to comment that line
// sprintf(cmd,"PBCTL 13 = %d;\n",PB_G(auto_extract));
and then, the compiling worked and created the php_primebase.dll
The question here is: How can I make it work without commenting that
line?
So, when the resulting extension, I used it on my PHP code, but I do
have some issues with the extension and I am not able to get into the
database.. It shows me errors like these on the browser screen
Warning: PrimeBase error: -7 (0) : "H"@client line 1: Illegal token: ''
in c:\appserv\www\k4\testindex.php on line 3
Could not connect
Im using this PHP code to access the database:
<?php
/* Connecting, selecting database */
$pbcon = primebase_connect("localhost","K4_DS","Admin","k4" ) or
die("Could not connect");
print "Connected successfully";
primebase_select_db("K4",$pbcon) or die("Could not select database");
print "Database Selected";
/* Performing SQL query */
$query = "SELECT * FROM users";
$result = primebase_query($query) or die("Query failed");
/* Printing results in HTML */
print "<table>\n";
while ($line = primebase_fetch_array($result, PRIMEBASE_ASSOC)) {
print "\t<tr>\n";
foreach ($line as $col_value) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
/* Free resultset */
primebase_free_result($result);
/* Closing connection */
primebase_close($pbcon);
?>
Question Two: Is there something wrong with this module?
I am using PHP 4.3.9 and the primebase_php.r7
Saludos,
Leo |