Welcome Guest, Not a member yet? Register   Sign In
PHP Making a local directory point to a web directory
#1

[eluser]Krisando[/eluser]
Hello people Smile

I'm trying to modify a local location of a directory and replace it with a web link.

The tiny code is:
Code:
server_path = "c:\ots\"

I've tried:
Code:
server_path = "http://localhost/"

No luck so far linking to a web directory =[
#2

[eluser]umefarooq[/eluser]
have u load database library, if not just go in config/autoload.php in libraries put database it will work fine.
#3

[eluser]Krisando[/eluser]
Hmm thats above my level something as simple as that =/
Is this in the webserver file?
I've found something called "autoloader.php" in my web server folder is that the same file?
#4

[eluser]umefarooq[/eluser]
no in you CI folder system/applications/config/autoload.php file just edit it. or in your controller function call this. $this->load->database(); it will load database library.

check this link

http://ellislab.com/codeigniter/user-gui...mples.html
#5

[eluser]Krisando[/eluser]
I've tried:
Code:
public function load($id)
{
$this->load->database();
// SELECT query on database
$this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ', ' . $this->db->fieldName('blocked') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch();
}

Still seems to be erroring, i've probably done something wrong.

If i can turn this local directory:
server_path = "c:\ots\"

Into a http web one then I can fix my problems by linking to the corrent files directly.
#6

[eluser]umefarooq[/eluser]
try this in your code just simple
Code:
$this->db->query("select id,password,email,blocked from accounts where id = $id");
#7

[eluser]slowgary[/eluser]
This thread confuses me (so much does these days). Krisando, your question is about paths or folders (or links/symlinks) or something similar, but umefarooq - your suggestion is autoloading the CI database library. I could be missing something, but this seems like 2 people sitting in a room, each having a conversation about something totally unrelated, yet taking turns as if they were talking to eachother. I need to lay off the rocks.

Anyways, have you figured out a solution to your problem Krisando? What is it exactly that you're trying to do? Are you configuring a server? What OS are you using?

If you're using Linux, you may be able to create a symlink to solve your problem. You say you're trying to link to a "web directory" but the address you've included is localhost, which would actually be a local directory. Can't you just type in the directory that localhost is serving?

I hope I haven't added any confusion to this thread. ;-P
#8

[eluser]umefarooq[/eluser]
before krisando put this query in first thread i think he modified it.
Code:
$this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ',
' . $this->db->fieldName('blocked') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch();

well really strange.




Theme © iAndrew 2016 - Forum software by © MyBB