Welcome Guest, Not a member yet? Register   Sign In
SQL query - strange behaviour?
#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.


Messages In This Thread
SQL query - strange behaviour? - by El Forum - 03-02-2009, 02:01 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 02:11 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 02:17 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 02:42 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 03:08 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 03:26 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 04:10 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 04:14 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 04:21 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 04:24 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 04:28 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 04:33 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 04:40 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 05:02 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 05:08 PM
SQL query - strange behaviour? - by El Forum - 03-02-2009, 06:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB