Welcome Guest, Not a member yet? Register   Sign In
  php mod % 3
Posted by: El Forum - 10-18-2007, 06:07 PM - No Replies

[eluser]webdezzo[/eluser]
Hey all,

This may or may not be a CI question (CI may have something useful to use for this) But, since this community rocks, I figured what the heck.

Lets say I have a 3 column layout like so:

Code:
<div id='column1'>
Content 1
</div>

<div id='column2'>
Content 2
</div>

<div id='column3'>
Content 3
</div>

And I select some data from my Database, that may return any number of records. I want to split this data into 3 arrays, that are equal (close plus or minus 1 due to odd / even) in length, so that echo the data from the 3 diffrent arrays in each column respectively. How could one go about doing this?

I would typically handle it if it were 2 columns with the mod function (% 2) but I am a little thrown off with the third column. I figure splitting the array based on the data would be the easiest method. Does CI have any easy array splitting functionality that I could say, take this data, split it into 3 arrays by taking the returned records and dividing them by 3?

Any ideas would be much appreciated!
Thanks!


  "%20" being automatically changed by CI to "_"
Posted by: El Forum - 10-18-2007, 04:27 PM - No Replies

[eluser]Najki[/eluser]
Hello,

I've created a web side driven by codeigniter. The user profile viewing page identifies the user by his username, so the links are, f.e. http://www.example.com/user/show/andrew123

Now the problem is when user has an account named f.e. "andrew 123". The browser changes " " to "%20". CI accepts "%" itself, but it automatically changes the whole "%20" to "_", so this users account can't be found.

I've been looking through the CodeIgniter's code in order to disable this function, but I haven't found it.

Could anyone tell me where it's located ?

Maybe some of you guys have a better idea of fixing it ?

Thanks for Your reply.

Best regards,
Najki


  enabling database just gives a blank page.
Posted by: El Forum - 10-18-2007, 04:04 PM - No Replies

[eluser]lebe0024[/eluser]
I triple checked my db parameters. My db server is running. CI doesn't report any sort of error.

I can access mysql using my command line. But CI seems to just exit out.


  getting id of just inserted record??? [solved]
Posted by: El Forum - 10-18-2007, 02:32 PM - No Replies

[eluser]mk3[/eluser]
Have a subtle question about codeigniters db class. I need to get id number after insertion. when saying id I mean Index with autoincrement. is this posible to do without queries?


$this->db->insert();
and now I need to get index of inserted entry.

[edit]found solution only 5 threads below take a look here:Thread.[edit]

Sorry for this my post


  I'm tasked with using relative file referencing. Is that even possible w/ CI??
Posted by: El Forum - 10-18-2007, 11:32 AM - No Replies

[eluser]Unknown[/eluser]
Since CI requires slash notation (www.x.com/index.php/a/b/) and URL params also use slash notation (www.x.com/index.php/a/b/c/d/, where c and d are url input parameters) it's totally killing my web page's ability to properly resolve to images. In other words, my web pages refer to images like this:

Code:
<img src="foo.gif" />

Lets imagine that my image appears properly on this page: "www.x.com/index.php/a/b/"

that's great. Now, if I pass a URL parameter (www.x.com/index.php/a/b/c/) my images won't load.

Please note that I must use *relative* file referencing, not absolute. In other words, I am not able to use the following construct:

Code:
<img src="/foo.gif" />

Can someone please help?

Thank you!
Jon


  URL parameters: Why difficult / impossible with CI?
Posted by: El Forum - 10-18-2007, 11:28 AM - No Replies

[eluser]Unknown[/eluser]
I'm writing an application that must take in a few parameters from the URL. That means I must accept them as traditional name/value pairs. Example:

myfile.php?name=jon&color=blue

The end user may want to pass me a few more name/value pairs too.. but the other ones are optional.. for example:

myfile.php?name=jon&color=blue&age=55&state=CA

It seems like code igniter requires me to use slash notation. What's the correct way for me to pass this stuff with CI's slash notation so that the variables are accessable by their names. For example:

$_GET["state"]

Thank you!
Jon


  get insert id - SOLVED - this->db->insert_id()
Posted by: El Forum - 10-18-2007, 11:10 AM - No Replies

[eluser]FuzzyJared[/eluser]
Is there a function for getting the the id of the insert that you just performed?

I am doing a multipart application, and need to get the insert id from one insert before I perform the next one.

I have looked around for this, but I am unclear if this exists within the db class or if I would have just do a sql query by hand.


  Problem with Download
Posted by: El Forum - 10-18-2007, 10:46 AM - No Replies

[eluser]Unknown[/eluser]
Is there a problem with the CodeIgniter 1.5.4 zip? I can only download 145K of the file.

Jim


  Including calendar template throughout multiple controllers
Posted by: El Forum - 10-18-2007, 09:52 AM - No Replies

[eluser]mrtopher[/eluser]
I'm using the CI Calendar library and things are working fine. Only thing is, I need to display the calendar is a couple of different places. I have created a calendar template, as outlined in the documentation, but now I'm trying to find a way to include that template throughout the controllers that need it.

I was looking at the code behind Bamboo Invoice and it looks like they do something similar with including common validation by putting into a file within views and then including it with the following:

Code:
$this->load->view('custom_validation/clients_validation.php', '', FALSE); // field validation

But when I do that with my calendar template it doesn't seem to work. Anyone have any ideas on how I can include this calendar template throughout multiple controllers?


  [image] gd i bmp
Posted by: El Forum - 10-18-2007, 08:35 AM - No Replies

[eluser]Unknown[/eluser]
Hello,
I have problems with GD library and BMP files.

Is it possible to resize bmp with GD?


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

Username
  

Password
  





Latest Threads
Best Way to Implement Aff...
by InsiteFX
07-07-2025, 03:06 AM
curl + response body
by michalsn
07-06-2025, 10:14 PM
AssetConnect - a powerful...
by Crenel
07-06-2025, 04:08 PM
twig and view cell
by foxbille
07-05-2025, 01:58 AM
The pipe operator in PHP ...
by InsiteFX
07-04-2025, 04:18 PM
Heads up for users using ...
by FlavioSuar
07-04-2025, 11:33 AM
Table (view class) Row ID
by grimpirate
07-03-2025, 11:22 PM
Happy 4th Everyone
by InsiteFX
07-03-2025, 09:31 PM
AbuseIPDB Module
by InsiteFX
07-03-2025, 09:27 PM
tool bar not showing
by Luiz Marin
07-03-2025, 04:46 AM

Forum Statistics
» Members: 155,648
» Latest member: rivieraclean
» Forum threads: 78,441
» Forum posts: 379,735

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB