Jump to content

rupam_jaiswal

Members
  • Posts

    29
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

rupam_jaiswal's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, Please excuse if similar issue has been posted earlier, my array is like this newScore1 is Array( [0] => Array ( [scoreid] => 12 [compid] => 4 [name] => andrew [score1] => 4 [score2] => 122 [score3] => 12 [score4] => DNF [rank1] => 5 ) [1] => Array ( [scoreid] => 15 [compid] => 4 [name] => Ed [score1] => DNF [score2] => DNF [score3] => 34 [score4] => DNF [rank1] => 0 ) [2] => Array ( [scoreid] => 14 [compid] => 4 [name] => andy [score1] => 34 [score2] => 21 [score3] => 34 [score4] => 34 [rank1] => 4 ) [3] => Array ( [scoreid] => 13 [compid] => 4 [name] => crusty [score1] => 1 [score2] => 0 [score3] => 34 [score4] => 0 [rank1] => T2 ) [4] => Array ( [scoreid] => 10 [compid] => 4 [name] => larry g [score1] => 1 [score2] => 1 [score3] => 23 [score4] => 34 [rank1] => T2 ) [5] => Array ( [scoreid] => 11 [compid] => 4 [name] => alex [score1] => 0 [score2] => 33 [score3] => 0 [score4] => 44 [rank1] => 0 )) I have to sort array with score1 values in ascending or descending order but if the value is 0 and DNF then it should always be at the bottom. eg priority_array = (0,'DNF')1) ascending ordernewScore1 is Array( [3] => Array ( [scoreid] => 13 [compid] => 4 [name] => crusty [score1] => 1 [score2] => 0 [score3] => 34 [score4] => 0 [rank1] => T2 ) [4] => Array ( [scoreid] => 10 [compid] => 4 [name] => larry g [score1] => 1 [score2] => 1 [score3] => 23 [score4] => 34 [rank1] => T2 ) [0] => Array ( [scoreid] => 12 [compid] => 4 [name] => andrew [score1] => 4 [score2] => 122 [score3] => 12 [score4] => DNF [rank1] => 5 ) [2] => Array ( [scoreid] => 14 [compid] => 4 [name] => andy [score1] => 34 [score2] => 21 [score3] => 34 [score4] => 34 [rank1] => 4 ) [1] => Array ( [scoreid] => 15 [compid] => 4 [name] => Ed [score1] => DNF [score2] => DNF [score3] => 34 [score4] => DNF [rank1] => 0 ) [5] => Array ( [scoreid] => 11 [compid] => 4 [name] => alex [score1] => 0 [score2] => 33 [score3] => 0 [score4] => 44 [rank1] => 0 ))2) descending ordernewScore1 is Array( [2] => Array ( [scoreid] => 14 [compid] => 4 [name] => andy [score1] => 34 [score2] => 21 [score3] => 34 [score4] => 34 [rank1] => 4 ) [0] => Array ( [scoreid] => 12 [compid] => 4 [name] => andrew [score1] => 4 [score2] => 122 [score3] => 12 [score4] => DNF [rank1] => 5 ) [3] => Array ( [scoreid] => 13 [compid] => 4 [name] => crusty [score1] => 1 [score2] => 0 [score3] => 34 [score4] => 0 [rank1] => T2 ) [4] => Array ( [scoreid] => 10 [compid] => 4 [name] => larry g [score1] => 1 [score2] => 1 [score3] => 23 [score4] => 34 [rank1] => T2 ) [1] => Array ( [scoreid] => 15 [compid] => 4 [name] => Ed [score1] => DNF [score2] => DNF [score3] => 34 [score4] => DNF [rank1] => 0 ) [5] => Array ( [scoreid] => 11 [compid] => 4 [name] => alex [score1] => 0 [score2] => 33 [score3] => 0 [score4] => 44 [rank1] => 0 )) Thanks
  2. HI, Please excuse if similar issue has been posted earlier. I want to check if a remote image exists or not. say if url is http://example/image.png and no image exists there, then...?? Earlier I was using @getimagesize function, but later on found this comment saying that it makes server slow for on large images. http://www.php.net/manual/en/function.getimagesize.php#88793 I don't know if the solution mentioned in that comment is correct rather efficient? Is there any other efficient, fast, small solution for this? Thanks in advance... Regards
  3. Hi, Excuse me if similar issue has been posted earlier. Am using ajax, calling url function getFeedWithComments(table,feed_id_1,page,cpage,hashval){ url = 'file1.php?action=feeds_comments&output=xml&table='+table+'&feed_id='+feed_id_1+'&page='+page+'&comment_page='+cpage; if(hashval){ url+= '&hashval=f'+hashval+'_c'; } createXHR(); sendRequest(url); } I can get the url called by either putting alert OR using live http headers but my client is not a savvy. I want him to view the current request url sent but how?? What will be the easiest way for this? Thanks in advance. Regards
  4. HI, In mysql, I have 2 tables friends, my_page. friends -------- id int(11) username char(40) person char(40) type enum('Friend','Blocked') id username person type ------------------------------------------------------ 13 king_nothing Musechild Friend 587 MrRogue ammo Friend 17 Honey MrRogue Friend my_page -------- id int(11) username varchar(30) page_owner varchar(30) date_posted datetime text text id username page_owner text date ------------------------------------------------------------ 4 Honey MrRogue PHP 2010-06-11 12:30:18 5 ammo MrRogue java 2010-06-08 10:54:52 6 mobster ammo both 2010-06-12 21:20:14 7 ammo Wizkid wrong 2010-06-12 21:39:29 8 Honey ammo show 2010-06-12 22:28:52 friends table tells freinds of each member, say MrRogue is friend of ammo, Honey.Note that MrRogue can come in either username/person field, not necessarily to be in username field. Now I want rows from my_page where my_page.username, my_page.page_owner both are friends of MrRogue, like 8 Honey ammo show 2010-06-12 22:28:52 Thanks in advance!!!! Regards
  5. HI, In mysql, I have 2 tables A and B Table A --- fields id int(50) message varchar(10000) username varchar(100) type enum('friend','game','admin') date_posted timestamp Table B --- fields id int(11) message text username varchar(30) page_owner varchar(30) date_posted datetime with some fields matching and some different. Now I have to select some values from both tables and combine the result in single something like SELECT distinct(id), message, username, type, date_posted FROM table A WHERE whereclause UNION SELECT distinct(id), message, username, page_owner, date_posted FROM table B WHERE whereclause ORDER BY date_posted DESC LIMIT 0, 12. Now my result set shows me id message username type date_posted ----------------------------------------------------------------------------------- 5 java ammo MrRogue 2010-06-11 13:39:38 4 PHP Honey MrRogue 2010-06-11 12:30:18 24 Rock MrRogue admin 2010-06-08 10:54:52 3 tata MrRogue game 2010-06-03 04:25:24 although 'type' field is present in not present for results of table B and 'page_owner' field is missing in results of table B. rows with id 5,4 are from table B rows with id 3,24 are from table A Its merging the 'type' and 'page_owner' fields into 1 field i,e 'type' in resultset. I want resultset like this id message username type page_owner date_posted ------------------------------------------------------------------------------------------------------------ 5 java is cool ammo NULL MrRogue 2010-06-11 13:39:38 4 PHP is my page Honey NULL MrRogue 2010-06-11 12:30:18 24 Rock and roll$$$$$ MrRogue admin NULL 2010-06-08 10:54:52 3 tata MrRogue game NULL 2010-06-03 04:25:24 id message username type page_owner date_posted ----------------------------------------------------------------------------------- 5 java ammo MrRogue NULL 2010-06-11 13:39:38 4 PHP Honey MrRogue NULL 2010-06-11 12:30:18 24 Rock MrRogue NULL admin 2010-06-08 10:54:52 3 tata MrRogue NULL game 2010-06-03 04:25:24 is it possible?? Thanks in advance!!!!!! Regards
  6. Hi, In mysql, I have a table A with fields f1,f1,f3,f4. I want to select some selected column values like f1,f2 and a new fictional column f5 whose value will always be 'luck'. say it should return f1 f2 f5 ------------------ a1 a2 luck b1 b2 luck c1 c2 luck Is there any way out?? Thanks in advance!!!!!! Regards
  7. Hi, There can be a records with username = '$username' even before running the UPDATE query, so If use SELECT * FROM inventory WHERE username = '$username' then it will fetch all the records which have not been modified by UPDATE command. I want only the affected rows with the UPDATE command. Regards
  8. Hi, I am using the following mysql query statement: mysql_query("UPDATE inventory SET username='$username' WHERE username='$target->username' ORDER BY RAND() LIMIT 15"); now I want to also display to the user which rows were affected by the above query and list all those rows in an echo or something. I know i can use mysql_affected_rows() to find HOW MANY rows were affected but can you make a script that will list the rows that were affected? or is it not possible? Regards
  9. Hi, I have a table tableA with fields id,item,sent_to,date_posted (datetime), delivery_hrs(int(2)) date_posted is time at which record is inserted into table, delivery_hrs in hrs (int) Here I want records whose date_posted when added to delivery_hrs results in date lesser than or equal to current date and time. eg If date_posted = '2010-01-13 02:30:00', delivery_hrs = 2, current datetime = '2010-01-13 05:30:00' then delivery_time = date_posted + delivery_hrs i,e '2010-01-13 04:30:00' which is lesser than current datetime = '2010-01-13 05:30:00'. What will be the sql for this?? Thanks in advance!! Regards
  10. Hi, Please excuse if similar issue has been posted earlier. My data is like I am going [ABCDEF]123[/ABCDEF] to movie. I want a regex to get the value between [ABCDEF] and [/ABCDEF] only if its integer. eg if its [ABCDEF]junk characters[/ABCDEF] then I dont want...but if its [ABCDEF]123[/ABCDEF] then I require 123 Regards
  11. Hi, I am using php gmdate(). Now I am entering all dates in my dbase using gmdate("Y-m-d H:i:s") I want 1 hr before datetime. So am using like gmdate("Y-m-d H:i:s", mktime(gmdate("H")-$hrs, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y"))); where $hr = 1 When I echo current date i,e $date = gmdate('Y-m-d H:i:s'); echo "<br/>current date is $date"; its 2009-12-27 03:54:08 and when echo my code of getting 1 hr before $date1 = gmdate("Y-m-d H:i:s", mktime(gmdate("H")-1, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y"))); its 2009-12-26 02:54:08 difference between these 2 days is 1 day and not 1 hr. I want 1 hr before datetime to be 2009-12-27 02:54:08 Can please anybody help. Thanks in advance Regards
  12. Hi, Thanks for your reply. But what will be the structure of new hobby table then?Will it be PersonID, Hobby and this hobby will have comma separated values like a1,a2...
  13. Hi, My table is like this Id,Name,Location,Hobby Condition is - if location is 1 then possible values of Hobby can be a1,a2,a3,a4,a5 - if location is 2 then possible values of Hobby can be b1,b2,b3,b4,b5 - if location is 3 then possible values of Hobby can be c1,c2,c3,c4,c5 - if location is 4 then possible values of Hobby can be d1,d2,d3,d4,d5 Now I have to get the row whose hobby value is suppose a1. How can I do this.I can't use like operator a1% as a100 will match then Regards
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.