Welcome Guest, Not a member yet? Register   Sign In
Firebird drivers for CI 1.7
#11

[eluser]JJB[/eluser]
a brief update...

I have got it where it will connect without error and I will be working this evening on getting it to read data, etc...

I will post my progress again tomorrow morning.
#12

[eluser]JJB[/eluser]
I have hit the same issue I had on CI 1.5 with the num_rows function and PHP's lack of that function for Firebird. There have been enough changes to the database base classes that my original hack didn't work. I am shooting to have a first cut by this Saturday. I will post again when I have more news.
#13

[eluser]rasaliad[/eluser]
[quote author="JJB" date="1241025743"]I have hit the same issue I had on CI 1.5 with the num_rows function and PHP's lack of that function for Firebird. There have been enough changes to the database base classes that my original hack didn't work. I am shooting to have a first cut by this Saturday. I will post again when I have more news.[/quote]

Hi Jeffrey

Thanks for you feedback. Here is a link to see if it can help in something. http://www.ibphoenix.com/main.nfs?a=ibph...ibp_howto1 in the example he write about

$result=ibase_query($conn,"select name from friends where name='$name'");
$num_rows=ibase_fetch_row($result);
if (!empty($num_rows[0])) {
echo "Name already exist: $num_rows[0] $back";
exit;
#14

[eluser]JJB[/eluser]
Unzip this and follow the instructions in the readme.txt file.
#15

[eluser]Max-B[/eluser]
I try immediately and tell you....
#16

[eluser]rasaliad[/eluser]
Hi, JJB

I did, what you explaing in the readme, but i get an empty screen in the firefox when the line $this->load->database() is execute. Could you please tell me what i'm doing wrong. I'm using windows XP and APPSERV with PHP 5.

Thanks for you support.

My database.php say:

$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "127.0.0.1"; /* i used localhost too */
$db['default']['username'] = "SYSDBA";
$db['default']['password'] = "masterkey";
$db['default']['database'] = 'D:\App\ATiempo\Datos\ATIEMPO.GDB';
$db['default']['dbdriver'] = "ibase";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "NONE";
$db['default']['dbcollat'] = "NONE";
$db['default']['dialect'] = 3;

And my controller say:

<?php
class Start extends Controller {
var $base;
var $css;

function Start()
{
parent::Controller();
$this->base = $this->config->item('base_url');
$this->css = $this->config->item('css');
$this->load->database(); /* IN THIS LINE I GET A WHITE BROWSER SCREEN, AND NO ERROR REPORTED */
}

...
#17

[eluser]JJB[/eluser]
The load->database() only loads the driver, you will need to load at least a view that issues a query or a get. I also set $autoload['libraries'] = array('database'); in the autoload.php file instead of doing the load call in the controller.

my controller looks like:

<?php

class POS_Controller extends Controller
{
function test1()
{
$this->load->model('system_menu_items');

$data['query'] = $this->system_menu_items->get_all();

$this->load->view('system_menu_items', $data);
}
}
?>


my model looks like

<?php

class system_menu_items extends Model {

function system_menu_items()
{
parent::Model();
}

function get_all()
{
$query = $this->db->get('system_menu_items');
return $query->result();
}
}
?>


my view looks like

<html>
<head>
</head>
<body>
<table border="1">
<tr>
<td>Parent ID</td>
<td>ID</td>
<td>Menu Text</td>
<td>Tip Text</td>
<td>Target Screen</td>
</tr>
&lt;?php
foreach($query as $row)
{ ?&gt;
<tr>
<td>&lt;?php echo $row->PARENT_ID;?&gt;</td>
<td>&lt;?php echo $row->ID;?&gt;</td>
<td>&lt;?php echo $row->MENU_TEXT;?&gt;</td>
<td>&lt;?php echo $row->MENU_TIP_TEXT;?&gt;</td>
<td>&lt;?php echo $row->TARGET_SCREEN_PATH;?&gt;</td>
</tr>

&lt;?php }
?&gt;
</table>
<br />
<table border="1">
<tr>
<td>Table Names</td>
</tr>
&lt;?php
$tables = $this->db->list_tables();
foreach ($tables as $table)
{ ?&gt;
<tr>
<td>&lt;?php echo $table;?&gt;</td>
</tr>
&lt;?php } ?&gt;
</table>
&lt;/body&gt;
&lt;/html&gt;


#18

[eluser]rasaliad[/eluser]
Hi, JJB

I appreciate your respond. Yes you are right, later in my controller there is something like:

$data['qrEmpleados'] = $this->db->get('empleados');
$this->load->view('testview', $data);

but i did not write it down in prior post i made, and then in the testview i have a foreach to process the qrEmpleados, but I'm sure that the program stop in the $this->load->database(); command, before i try $autoload[‘libraries’] = array(‘database’); and it did not work too.

Did you see my database.php setting? are there correct?.

How looks you database.php?

let me tell you that I'm very good in delphi and firebird, but in PHP I'm new. this is my first web project, and I decide to use PHP and CodeIgniter and I could no start because can not connect to firebird, the database is full of procedures and triggers and UDF.

JJB, thank you very much, for your time.

--------------------------------------------------------------
Rafael Liriano
SONEINSA
#19

[eluser]JJB[/eluser]
my database.php file contains the following:

$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "sysdba";
$db['default']['password'] = "*********";
$db['default']['database'] = "/data/POS.fdb";
$db['default']['dbdriver'] = "ibase";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "NONE";
$db['default']['dbcollat'] = "NONE";
$db['default']['dialect'] = 3;


I do have a Windows Virtual Machine that I can trying setting up a similar setup as you have. I will let you know what I find.
#20

[eluser]rasaliad[/eluser]
Hi JJB

Again thank you. I will wait what you could find in windows. while I will be trying to do my best.

--------------------------------------------------------------
Rafael Liriano
SONEINSA




Theme © iAndrew 2016 - Forum software by © MyBB