Member Avatar

Hi, I'm trying JSON for the first time and I have a php file that returns this: [CODE] [{"userID":"39160902151","content":"I really can't wait to get this thing done :-)","published":"2011-06-07 10:33:35"}] [/CODE]. What do I do if I want to display only the userID from this data using javascript. I load this into javascript like this: [CODE] var displayfeeds = new ajaxObject('ajax/users/display.feeds.php'); displayfeeds.callback = function (responseText,status) { var feed = JSON.parse(JSON.stringify(responseText)); $("#feeds-feedback").html(feed);//I need the userID from feed } displayfeeds.update(); [/CODE] Thank you in anticipation :-)

Member Avatar
+0 forum 1
Member Avatar

Hi everyone, Can anyone tell my why this does not work? I created a stored procedure that uses a variable / input value as table name, but it does not do what it's supposed to do. Here is the code: [CODE] delimiter // DROP PROCEDURE IF EXISTS userpages.respondtoconnectionrequest// CREATE DEFINER = 'sithembiso'@'localhost' PROCEDURE userpages.respondtoconnectionrequest(IN tname VARCHAR(23),IN response INT,IN ouserid INT(14),IN fuserid INT(14),IN fftable VARCHAR(23)) BEGIN SET @u = CONCAT('UPDATE `userpages`.`',tname,'` SET `status`=',response,' WHERE `',tname,'`.`userID`=',fuserid); PREPARE stmtu FROM @u; EXECUTE stmtu; DEALLOCATE PREPARE stmtu; IF (response = 1) THEN SET @i = CONCAT('UPDATE `userpages`.`',fftable,'` SET `status`=',response,' WHERE `',fftable,'`.`userID`=',ouserid); PREPARE stmti FROM …

+0 forum 0

The End.