Welcome Guest, Not a member yet? Register   Sign In
  models being assigned to themselves
Posted by: El Forum - 08-17-2007, 01:51 PM - No Replies

[eluser]Unknown[/eluser]
I'm on 1.5.4 and I'm noticing that models are being assigned to themselves by the function _assign_libraries in the Model.php library. I think line 62 should be changed from

Code:
if ( ! isset($this->$key) AND $key != $this->_parent_name)

to

Code:
if ( ! isset($this->$key) AND $key != strtolower($this->_parent_name))

because the key will always be all lowercase while the model's _parent_name variable will be capitalized.


  Scaffolding and MS SQL Server 2000
Posted by: El Forum - 08-17-2007, 01:43 PM - No Replies

[eluser]Unknown[/eluser]
Didn't find this on the forums. Database connection set up with ODBC driver to local SQL Server 2000. WinXP Pro x64, SQL Server 2000 RTM, PHP 5.2.3, Apache 2.0.59, CI 1.5.4. Working through the Blog example, and trying to get scaffolding set up:


database.php:

Code:
$active_group = "default";

$db['default']['hostname'] = "MYDSN";
$db['default']['username'] = "myusername";
$db['default']['password'] = "mypassword";
$db['default']['database'] = "MYDB";
$db['default']['dbdriver'] = "odbc";
$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'] = "";

Controller:
Code:
<?php
class Blog extends Controller {

       function Blog()
       {
            parent::Controller();
            $this->load->database();
            $this->load->scaffolding('table_name');
       }

}
?>

When I go to the scaffolding URL, I get the following error:

Quote:An Error Was Encountered

Error Number: 37000

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '`'.

SELECT COUNT(*) AS numrows FROM `table_name`

Apparently SQL Server 2000 does not like backwards ticks in queries. I verified this in MS SQL Query Analyzer. Normal single-quotes produce the same error; only double-quotes do not produce an error in Query Analyzer.


  how to Ignite others codes with mine?! (CI codes)
Posted by: El Forum - 08-17-2007, 10:37 AM - No Replies

[eluser]Shadi[/eluser]
Hello,

I'm currently developing a news script, and one of the requirement is to enable including of the "last 10 posts" remotely into another script outside CI framework ... how I could accomplish something like that?

I remember seeing a topic about encapsulating CI into a file or something which might help?

any suggestions?


  RESTful Web Services
Posted by: El Forum - 08-17-2007, 10:32 AM - No Replies

[eluser]dondani[/eluser]
Hi people,

Congratulations for the great community you have developed around this great piece of software.

My question: is it possible to develop RESTful web services with CodeIgniter (or with PHP in general)?

I've been investigating a bit, and have found two frameworks: Tonic (quite old, looks abandoned) and Konstrukt (just starting). I haven't delved into their code yet.

There aren't many articles that touch this subject either. I've found this:
http://www.onlamp.com/pub/a/php/2003/10/..._rest.html
It only shows how to consume RESTful web services (using cURL), but not how to create one.

Also, a book about RESTful web services has just come out:
http://www.oreilly.com/catalog/9780596529260/
It talks about Ruby on Rails, Restlet, and Django, but sadly no PHP!

I would appreciate any kind of information you can give me. Thank you.


  CI database limitations?
Posted by: El Forum - 08-17-2007, 09:58 AM - No Replies

[eluser]walterbyrd[/eluser]
I have some concerns about ci's ability to handle complex database relations. I understand that ci does not have an ORM - is that especially significant?

I am considering a project that has about six tables. I don't think I need any onetomany or manytomany relationships. But I may need to relate a few tables. Maybe some foreign keys.


  Coneccting to a database using MySQL port
Posted by: El Forum - 08-17-2007, 08:19 AM - No Replies

[eluser]Carlton[/eluser]
Hey,

I checked the documentation for the DB class and it mentions that port support when connecting to a DB is only supported when using the postgre driver type.
Is there a reason for not including it for mysql/mysqli or is it just a case of not getting round to it.

I checked the file at system/database/drivers/mysqli/mysqli_driver.php and noticed that within the 'db_connect' function you can add two extra parameters to 'mysqli_connect' (dbname and port) and it seems to work ok.

I wondered if anyone has attempted something similar or could explain why the ports are not supported just yet.

Thanks....

C


  session destroyed by anchor!
Posted by: El Forum - 08-17-2007, 08:12 AM - No Replies

[eluser]ph1k3l3d[/eluser]
Hello,

My first time, but I am not shy.

Straight to my issue, I have a session (CI session with DB) that holds data from a multi-page form.

All is well unless I put an <a href="somesite.com">Link</a> into the session. (Part of the form is to allow text and links).

If I have a peek at the session immediately after writing the link to it, I see it but at the next page, when more data is added all of the previous stuff I put in there has gone and only the new stuff is visible.

I have tried addslashes, htmlentities, htmlspecialchrs and all that good cleaning PHP stuff but I get the same result every time. If I enter just plain text into the form I get right through the process without a grumble.

I have searched the forums for any info but can't seem to find anything relating to this and its friday, I need stress free beer later so I want to get this sorted and get to the pub. Anyone have any ideas?

Cheers


  Routing problem
Posted by: El Forum - 08-17-2007, 02:09 AM - No Replies

[eluser]Unknown[/eluser]
Hi everyone!

I wanted to simply redirect some url like this:
/welcome/ => /welcome/
/fr/welcome/ => /welcome/
/it/welcome/ => /welcome/
/de/welcome/ => /welcome/

I've added those rules to my routing.php

Code:
$route['^fr/(.+)$'] = "$1";
$route['^it/(.+)$'] = "$1";
$route['^de/(.+)$'] = "$1";

It works great with 'it' and 'de' but it doesn't work with 'fr'.... Any idea?

Ben


  Using log4php with code igniter
Posted by: El Forum - 08-16-2007, 09:28 PM - No Replies

[eluser]mazaka[/eluser]
Hi all!

Its the first project I am using CI in, and I like it a lot.

My question tho: On every page request I want a log entry to be written with a handful of variables, such at timestamp, useragent, pageId etc. This is all for statistics reasons, on the live system. not debugging.

Has anyone used the log4php project for this, and where would the the best integreation point be? I started out by including it at the very top of my main layout view, but now I think I should move it to the general controller if possible.

cheers.

Any good loggin ideas are welcome!


  Using the Logging class
Posted by: El Forum - 08-16-2007, 05:11 PM - No Replies

[eluser]stevefink[/eluser]
Hi all,

I'm having difficulty converting an object to an array so that I can json_encode it. Is there anyway I can use log_message to determine if the following data construct is an object or array?

$data['models'] = $this->autodb->get_models($make_val);

Do I need to throw something like this into my controller:

Code:
if ( is_object( $data['models'] ) )
{
    log_message('info', "message here?");
}

I'm sure the above is an object, because my error logs tell me json_encode can't properly handle it. But I'd like to be able to utilize the logging class to help me debug in the future.

Thanks!


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

Username
  

Password
  





Latest Threads
Changing Session cookie -...
by codeus
1 hour ago
which linter to use (and ...
by paulbalandan
1 hour ago
Update from 4.6.0 to 4.6....
by Vespa
Yesterday, 01:17 AM
hot-reload side effects s...
by InsiteFX
05-17-2025, 10:11 PM
using app/Config/App.php ...
by sam547
05-16-2025, 03:04 PM
Setting baseURL in Regist...
by grimpirate
05-15-2025, 02:20 PM
CRUD Code Generator
by DeanE10
05-15-2025, 05:31 AM
CI debugging tools
by Montasser
05-14-2025, 02:54 PM
CodeIgniter.com - Report ...
by Harry Lyre
05-14-2025, 04:26 AM
Missing closing bracket w...
by abf
05-13-2025, 07:27 PM

Forum Statistics
» Members: 146,892
» Latest member: m8winpoker
» Forum threads: 78,392
» Forum posts: 379,479

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB