Welcome Guest, Not a member yet? Register   Sign In
  help .. i cant connect to my databse
Posted by: El Forum - 04-20-2008, 08:31 PM - Replies (4)

[eluser]Unknown[/eluser]
help! im new pretty new in using codeIgniter.. iv followed the instruction and installed the whole thing. unfortunately, i can’t connect to the database .. im using postgre .. this is how my database.php looks like:

$active_group = “default”;

$db[’default’][’hostname’] = “192.168.1.254”;
$db[’default’][’username’] = “elisha”;
$db[’default’][’password’] = “elisha1104”;
$db[’default’][’database’] = “test”;
$db[’default’][’dbdriver’] = “postgre”;
$db[’default’][’dbprefix’] = “”;
$db[’default’][’active_r’] = TRUE;
$db[’default’][’pconnect’] = TRUE;
$db[’default’][’db_debug’] = TRUE;
$db[’default’][’cache_on’] = FALSE;
$db[’default’][’cachedir’] = “”;

?>

and autoload.php already contain this line:

$autoload[’core’] = array(’database’);

im really new at this.. in fact i have just recently learned how to program.. but i had to do this project for our major so i have to learn quick ...


  i can't connect to my databse
Posted by: El Forum - 04-20-2008, 08:29 PM - Replies (1)

[eluser]Unknown[/eluser]
help! im new pretty new in using codeIgniter.. iv followed the instruction and installed the whole thing. unfortunately, i can't connect to the database .. im using postgre .. this is how my database.php looks like:


$active_group = "default";

$db['default']['hostname'] = "192.168.1.254";
$db['default']['username'] = "elisha";
$db['default']['password'] = "elisha1104";
$db['default']['database'] = "test";
$db['default']['dbdriver'] = "postgre";
$db['default']['dbprefix'] = "";
$db['default']['active_r'] = TRUE;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";



?>

and autoload.php already contain this line:

$autoload['core'] = array('database');

im really new at this.. in fact i have just recently learned how to program.. but i had to do this project for our major so i have to learn quick ...


  Active record can't handle 2 CONCATs?
Posted by: El Forum - 04-20-2008, 06:13 PM - Replies (4)

[eluser]kirilisa[/eluser]
I just wrote a SQL statement as follows:

Code:
$this->db->select("c.contactId, c.disableFlag, c.typeCode, c.organisation");
$this->db->select("CONCAT_WS(' ', c.titleCode, c.firstName, c.lastName) as name");
$this->db->select("CONCAT_WS(' ', a.addressLine1, a.addressLine2, a.addressLine3) as address");
$this->db->from('Contact c');
$this->db->join('Address a', 'a.contactId = c.contactId');

it crashed with an error:
Code:
Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near ') as address FROM (`Contact` c) JOIN `Address` a ON a.contactId =
c.contactId ' at line 1

SELECT c.contactId, c.disableFlag, c.typeCode, c.organisation, CONCAT_WS(' ', c.titleCode,
c.firstName, c.lastName) as name, a.addressLine1, a.addressLine2, a.addressLine3) as address FROM
(`Contact` c) JOIN `Address` a ON a.contactId = c.contactId

Note that the second CONCAT_WS doesn't show up. It seems that Active Record can't deal with two CONCATs being in 1 statement?


  Easy Question - Comments_View and Showing Article
Posted by: El Forum - 04-20-2008, 03:38 PM - Replies (13)

[eluser]Kesey[/eluser]
I'm a beginner w/ PHP and CI. I've followed the blog tutorial and I'm trying to get the entry that one is commenting on to show up at the top of the comments page.

I can get all of the entries to show up, similar to how it works on the main blog page, but how can I get just the one entry instead of using the loop to pull them all?

Controller:

Code:
function comments()
    {
        $data['query'] = $this->db->get('entries');
        $this->load->view('commentsview', $data);
    }

View:
Code:
<!--Get Article-->
    <?php foreach($query->result() as $row): ?>
        <h3>&lt;?=$row->title?&gt;</h3>
        <p>&lt;?=$row->body?&gt;</p>
        <p>&lt;?=anchor('blog', 'Back to Blog');?&gt;</p>
        <hr>        
    &lt;?php endforeach; ?&gt;
&lt;!-- End Get Article--&gt;

Thanks!


  Web Services, Queues, polling them... best practices?
Posted by: El Forum - 04-20-2008, 03:33 PM - Replies (4)

[eluser]andjules[/eluser]
Hi, looking for the opinion of more experienced developers (than me)...

I'm building an app that uses web services (for uploading, transcoding, image manipulation, etc.)... Most of the critical calls to the web services either i) are processed immediately, or ii) file a callback to me when they're done processing.

HOWEVER, there are a few instances where processing might take a while, and the service API doesn't fire a callback on completion, so:

It seems if something isn't ready when I first request it, I need to set up a queue, then poll the queue and re-check, until the service is done processing the original request, at which point I delete from the queue.

a) I'm aware of Amazon SQS, I'm aware of Apache MQ (which I keep hearing is a pain), are there any other local PHP practices for creating a queue (memcached?)?
b) what's the best practice for polling the queue? Cron? (that doesn't seem very elegant...)

Thanks in advance


  Image Resizing Errors.
Posted by: El Forum - 04-20-2008, 11:23 AM - Replies (3)

[eluser]JasonS[/eluser]
I cannot work this one out.

Errors

Source Image Location
New Image Location
Error

Quote:/home/jasonsta/public_html/classified/uploads/images/2df75e2589145241a897d76820620fc2.jpg
/home/jasonsta/public_html/classified/uploads/thumb/2df75e2589145241a897d76820620fc2.jpg

Your server does not support the GD function required to process this type of image.

Code
Code:
$resize['image_library'] = 'GD';
$resize['source_image'] = $upload_dir.'images/'.$this->upload->file_name;
$resize['new_image'] = $upload_dir.'thumb/'.$this->upload->file_name;
$resize['create_thumb'] = TRUE;
$resize['maintain_ratio'] = TRUE;
$resize['width'] = 100;
$resize['height'] = 100;

$this->load->library('image_lib', $resize);

$this->image_lib->resize();

My host assures me that GD library is set up and working. php_info confirms this.

Are there any other settings I need to configure to get this running?


  Can't destroy session
Posted by: El Forum - 04-20-2008, 11:05 AM - Replies (17)

[eluser]steelaz[/eluser]
I simplified my logout function to:

Code:
function logout()
{
    $this->session->sess_destroy();
    log_message('error', 'mailcode: '. $this->session->userdata('mailcode'));
}

but I still get value from session in error log. Any suggestions how to troubleshoot this?


  Need help getting application base path
Posted by: El Forum - 04-20-2008, 10:09 AM - Replies (6)

[eluser]mmatos[/eluser]
Hello,

I'm working on my 2nd CI application, and my goal is to make my applications "ultraportable" - basically upload and run.

Right now, I'm working on an image upload/delete administration section.

When a user deletes an image, a function called deleteImage in my model will get called:

Code:
function deleteImage($image_id) {
        $this->db->where('image_id', $image_id);
        $query = $this->getImageById($image_id);        //retrieve some info so we can delete the file.
        $imageinfo = $query->result();
        $imagetodelete = $imageinfo[0]->image_filename;
        $imagepath = $this->config->item('image_uploads');

        $filedelete = $imagepath . $imagetodelete;

        echo "Delete: $filedelete<br><br>";

        print_r($this);
        die();

        $this->db->where('image_id', $image_id);
        $this->db->delete($this->_table);
        return $this->db->affected_rows();
    }

My problem is in this:
Code:
$filedelete = $imagepath . $imagetodelete;

I need to get the FULL path to that image starting from root. I don't see a function in the CI documentation that returns the applications base directory (eg: c:\wamp\www on my dev box, or /home/user/www on prod box.)

For portability reasons, I do not want to hard code it. I'm sure I'm just missing something.

Thanks.


  ?one viewer?
Posted by: El Forum - 04-20-2008, 10:07 AM - Replies (2)

[eluser]bigtime[/eluser]
Hi all, i have a slight problem with a CI project that i'm working on.

For some strange reason when i'm passing out multiple views (header, content, footer, etc..) its only rendering the last view, does anyone have any thoughts into why this vould be the case?


  Adding a user id column to CI's session table
Posted by: El Forum - 04-20-2008, 09:11 AM - Replies (5)

[eluser]stevefink[/eluser]
Hi all,

I'm looking to affiliate each row in CI's session table with a particular user. The user has an id in a relating entity (different table). Have any of you found a best practice to incorporate this ID into the session table?

I'm personally thinking just adding a column, stuffing the user_id into the user's session store, then retrieving that and updating the cookie table once it's available. Not sure if I can think of a better algorithm right now.

Any ideas?

/sf


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Trying to remove index.ph...
by Bosborne
1 hour ago
Convert Filters to Regist...
by Willen
3 hours ago
Top 10 PHP Testing Framew...
by FlavioSuar
7 hours ago
CL4 Connecting to a Remot...
by cx3700
Yesterday, 07:33 PM
codeigniter.com/user_guid...
by kenjis
Yesterday, 07:29 PM
As experienced web develo...
by kenjis
Yesterday, 06:03 PM
Filters in filters folder...
by xsPurX
Yesterday, 03:01 PM
Request URL 404 Amazon EC
by robrym
Yesterday, 01:04 PM
Integrating Bootstrap 5 i...
by captain-sensible
Yesterday, 09:17 AM
request URL not found
by captain-sensible
Yesterday, 09:04 AM

Forum Statistics
» Members: 86,104
» Latest member: lottery24online
» Forum threads: 77,603
» Forum posts: 376,116

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB