Welcome Guest, Not a member yet? Register   Sign In
SQL query - strange behaviour?
#11

[eluser]TheFuzzy0ne[/eluser]
Not off the top of my head, sorry. To my understanding, MySQL is the database of choice.
#12

[eluser]TheFuzzy0ne[/eluser]
One more thought; why not try to use good old fashioned PHP to connect, and run the same query? That will confirm whether or not CodeIgniter is really the problem here.

EDIT: Might be worth checking the 'remote login timeout', too.
#13

[eluser]Las3r[/eluser]
Okay, will do that now.
#14

[eluser]Las3r[/eluser]
BUSTED!

I had one of the columns in the table set as ntext in stead of text, this screwed up the CI class (i found it out by using the manual connection + query).

Thank you!

Now there's 1 thing left.

Since I'm trying to code clean with the use of MCV, could you explain what is best practise when it comes to for example my ticket system?

Step 1)
Controller loads model that fetches all tickets for the logged in user

Step 2)
Model queries for information, HOW do I pass this back to the controller ? I'm currently using return $result; , however when I try to echo the result I am expecting "Array" in stead of
Quote:A PHP Error was encountered

Severity: 4096

Message: Object of class CI_DB_mssql_result could not be converted to string

Filename: models/support_functions.php

Line Number: 44

My SQL table layout is as following:

Quote:CREATE TABLE [dbo].[support_tickets](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Sender] [varchar](10) NOT NULL,
[Category] [nchar](25) NOT NULL,
[ticket_title] [varchar](15) NOT NULL,
[Ticket_Contents] [text] NOT NULL,
[Date] [datetime] NOT NULL,
[Last_Edit] [datetime] NOT NULL,
[Is_Answered] [int] NOT NULL,
[Supporter] [varchar](50) NULL
)

I worked before with "single" rows that are being passed back, however multiple rows (in this case -> 1 user can have multiple tickets) seem to be a problem for me...

At least I'm happy you helped me on the way, i'll try and keep testing if I can get this to work.
#15

[eluser]Las3r[/eluser]
I got it done, unbelievable how muhc trial and error can mean to human kind.

Thanks for everything !
#16

[eluser]TheFuzzy0ne[/eluser]
Haha! Glad you got it sorted. Smile




Theme © iAndrew 2016 - Forum software by © MyBB