Welcome Guest, Not a member yet? Register   Sign In
  Multiple Tables in FROM Statement in DB Active Record
Posted by: El Forum - 04-13-2008, 10:46 AM - Replies (1)

[eluser]lay-z-cow[/eluser]
Hi,

maybe this question is stupid, but I couldn't find anything about this in the User Guide:

I want to start a mySQL query like this:

Code:
SELECT
person.person_id,
person.name,
bew2proj.status_id,
bew2proj.b2w_id,
company.company_id,
company.name
FROM
bew2proj,
person,
company
WHERE
bew2proj.person_id = person.person_id
AND person.company_id = company_id.company_id_id
AND person.company_id = ' . $company_id . '
AND bew2proj.projekt_id = ' . $_POST['ID'];

How do I rewrite this query for the Active Record? Do I have to use JOIN?


greetings

Chris


  Running CI on MediaTemple (gs)... 404 nightmare
Posted by: El Forum - 04-13-2008, 09:53 AM - Replies (9)

[eluser]Daniel H[/eluser]
Hi all,

I've just got a new (gs) service on MediaTemple, but despite everything having been configured correctly I'm getting a CI 404 Page Not Found error. Looking at the log files:

Code:
DEBUG - 2008-04-13 08:50:48 --> Config Class Initialized
DEBUG - 2008-04-13 08:50:48 --> Hooks Class Initialized
DEBUG - 2008-04-13 08:50:48 --> URI Class Initialized
ERROR - 2008-04-13 08:50:48 --> 404 Page Not Found -->

Can anyone tell what the problem might be?

Thanks,
Dan.


  how di I get view to echo iteger key arrays?
Posted by: El Forum - 04-13-2008, 08:25 AM - Replies (3)

[eluser]ICEcoffee[/eluser]
Hi all, I know this is probably simple, but I'm just getting to grips with PHP OOP/MVC.

I know and have successfully written code to pass associative array data to a view in Codeigniter ie:

Controller:

Code:
$data['name'] = "Harry";
$data['country'] = "UK";
$this->load->view('profile');

Then in the view file:
Code:
<?php echo $name; echo $country?>

but how do I echo an indexed array? where the array in the controller is:
Code:
$data = array(1=>, "Harry", "Country");

I want to produce a menu list, so I don't want to use pass an associated array?

Any help please?


  Security questions
Posted by: El Forum - 04-13-2008, 08:15 AM - Replies (7)

[eluser]obobo[/eluser]
I'm just wrapping up my first project using CI, and have a couple of security related questions ...

include()
In a couple of situations I've used php's include() rather than $this->load>view() to create nested views. Does this have any security implications?

QUERY STRINGS
In order to get a scriptaculous ajax script to work I needed to use query strings for one url rather than POST - which means i've had to enable query strings in the config file. I have read in several places that one of the security features of CI is that it only uses POST. Should i be worried about enabling query strings?

any insights appreciated.


  Image Uploader / thumbnail - controller question
Posted by: El Forum - 04-13-2008, 08:11 AM - Replies (8)

[eluser]deadfrog[/eluser]
Hi guys - I'm making an image uploader for my girlfriends website and if I don't get it done soon I'm for it, you know how it is Smile

Anyway, I have the uploader part working fine, and I can get my 'upload success' page to display the details of the image in an array.

What I need to do next is to use the image manipulation class to create a thumbnail 200px wide, and display it on the next screen.

First question (and I'm sure this is REALLY easy) is how do I manipulate the array in the controller so I can extract the image name (to pass to the thumbnail creator)? I can't get it to work and it seems so simple I'm sure I'm overthinking it. $this->upload->data() is the array I have after upload.

Second question, once uploaded, if I repeatedly refresh the screen it'll continue to post the form and upload more images. I guess this is linked to the first question as I can stop it from uploading if the file name is the same (or something), but is there a better way?

Thanks for your time, sorry if I'm being thick!


  Variables in language strings.
Posted by: El Forum - 04-13-2008, 05:27 AM - Replies (3)

[eluser]Young Caveman[/eluser]
Hi to you all. Smile

There's no problem when i have to display a message like:

"User added Successfully."

What if I have to display ALSO the username of the user just created? I can't specify the username in the language files cause obviously the username is changing everytime a user is created.

"User [USERNAME] added successfully". <-- It is possible to do this? And if yes , how i can do that?

Thanks in advance.

Don ~ Alberto (Italy, so please try to undestand my english ;P)


  Matching strings
Posted by: El Forum - 04-13-2008, 05:18 AM - Replies (2)

[eluser]Animas[/eluser]
In my blog type app I used

Code:
$this->db->where('title', $this->uri->rsegment(3));
to match an entry(didn't use traditional "id" here).

1. If a entry in db is like "My post title a" then matching [assume $this->uri->rsegment(3) is "My post title a"] doesn't work. See each word is separated by "space".

2. But ff a entry in db is like "my-post-title a" then matching [assume $this->uri->rsegment(3) is "my-post-title a"] works. To do this I will have to enter title entries into db as "my-post-title a" which I don't want. See each word is separated by "-".

So how do I make 1(space) work?


  CodeIgniters session library - how to?
Posted by: El Forum - 04-13-2008, 04:30 AM - Replies (3)

[eluser]v33s[/eluser]
Hello all,
I am new in CodeIgniter and I have a question about CodeIgniters Sessions. Can someone explain me how to start write simple admin login page area? I tried most of complete Authorization Systems but I don`t understand how to implement them in my code.

Ok. I have my `admins` MySQL table with -id-name-md5password- columns.

On first place in my Contructor, i have that code:

Code:
$this->load->library(array('session', 'validation'));

I would like to check the form values with the database values, if it is correct then make a session.

I can extract user from database, but how to make a session, check it if admin is now logged in???

I found in User Guide how to make a session:

Code:
$newdata = array(
                   'username'  => 'johndoe',
                   'email'     => '[email protected]',
                   'logged_in' => TRUE
               );

$this->session->set_userdata($newdata);

And now, what I must change in this array? Replace username with this from database?
How to check this session if it is correct?

Sorry for my English Wink


  Convert to title style uppercase
Posted by: El Forum - 04-13-2008, 12:17 AM - Replies (4)

[eluser]Animas[/eluser]
Hi,
I need to convert "my post title" to 'My Post Title". How can I do that?

Thanks.


  Ajax Updater should work on js function call... But it dont...
Posted by: El Forum - 04-12-2008, 11:08 PM - Replies (2)

[eluser]Rubiz'[/eluser]
Hi!! I'm trying to do a Ajax Updater function outside button click; I had to do this in a normal javascript function, I'm trying like that:

Code:
&lt;!--
    function setAdress()
    {
        var adress = '&lt;?=base_url()?&gt;index.php/email/preview/' + $('id_category').getValue();
        new Ajax.Updater('preview', adress ,{evalScripts:true});
    }
--&gt;

It should work, don't?
Its not working... anyone knows why?


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

Username
  

Password
  





Latest Threads
Codeigniter4 version 4.5....
by kenjis
3 hours ago
SQL server connection not...
by kenjis
3 hours ago
Problem with session hand...
by kenjis
4 hours ago
Is it possible to go back...
by kenjis
4 hours ago
Cannot access protected p...
by xsPurX
5 hours ago
Update to v4.5.1, same us...
by xsPurX
11 hours ago
How to use Codeigniter wi...
by kenjis
Today, 05:06 AM
CVE-2022-40834 SQL Inject...
by kenjis
Today, 03:44 AM
Retaining search variable...
by pchriley
Today, 03:15 AM
Disable debug output in v...
by groovebird
Today, 02:26 AM

Forum Statistics
» Members: 85,384
» Latest member: Manclub team
» Forum threads: 77,581
» Forum posts: 376,007

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB