I have a custom template setup in javascript / jquery and I need to drag data from a CodeIgniter controller and return it to JSON In js / jquery template I believe my argument is correct, but for some reason nothing is working and at the beginning of my script I get the following error:
Uncuit Syntax Error: Input Unexpected end
How would I go about doing this? The code I have written so far has been shown below:
$ ("# Projects"). Click (function () {jQuery.ajax ({type: "POST", Data type: "JSON", Url: "& lt;? = Base_url ()? & Gt; index.php / home / projectsslider", data : DataRring, Jason: {returned: right}, success: work (data) {if (data is true) {$ ("# content"). Fadeaut (150, function () {$ (this). Raffles (ProjectSlider (), Function () {var html = projectsSlider (data.projectId, data.projectName, data.startDate, Data.finishedDate, data.createdFor, data.contributors, data.screenshotURI, data.websiteURL); jQuery (html)
This is my PHP:
Code> Function Projects Slider () {$ query = $ this- & Gt; db- & gt; Query (IDE Project DESC by order from "Select" projects); Foreign exchange ($ query-> result () as $ line) {$ projectId = $ row-> ; Project ID; $ ProjectName = $ row-> ProjectName; $ StartDate = $ line- & gt; get started; $ end date = $ row- & gt; ended; $ created = $ row- & gt; Created; $ Contributor = $ row-> Contributor; $ ProjectDesc = $ row- & gt; Projectdask; } $ Query1 = $ this- & gt; Db- & gt; Query ("Select * from Screenshots S Association = '{$ projectId}' s.idscreenshot ordered by DESC;); Foreign Exchange ($ query1-> result () as $ line2) {$ screenshotURI = $ Row2- & gt; screenshotUSRI; $ websiteURL = $ line- & gt; website URL;} $ StartDate, 'finishedDate' = & gt; $ end date, 'ProjectDesc' = & gt; $ projectDesc, 'createdFor' = & gt; ; $ Madefair, 'Contributor' => $ Contributors, 'ScreenshotsIRI ='> $ screenshotURI, 'websiteURL' => $ websiteURL));}}Any thoughts as to why is happening?
< V class = "post-text" itemprop = "text">
The problem looks like you have a trail)
Edit: Someone replied when I was refactoring, But I offer this version anyway:
project code ($ {$ Quote = $ this-> db- & gt; query ("SELECT * FROM Projects Order Ordject DESC "); $ Project = $ query- & gt; Fetch (PDO :: FETCH_OBJECT); $ Project- & gt; Screenshot = array (); $ Query = $ this- & gt; Db- & gt; Query ("Select $ * from ScreenshotsWHERE projectId =" $ projectId "by ordering DESC" DESC "); Foreign Exchange ($ query-> results () $ as screenshot) {$ project-> Screenshots [ ] = $ Screenshot;} echo json_encode (array ('returned' = & gt; true, 'project' => gt; $ project));} You can get objects, you do not have to do all those looping and converting them.
Comments
Post a Comment