Click here to Skip to main content
Sign Up to vote bad
good
See more: insertBug
                            $insq='SELECT subcode FROM 2-1subjects'; 
                                if(!$insq) { die('invalid Query:'.mysql_error()); }
 
                                       $insre=mysql_query($insq);
                                      //print_r ($insre);
                                       print_r ($mark).'<br>';
                                      while($subrow=mysql_fetch_array($insre))
                                      {
                                        print_r ($subrow).'<br>';
                                        $inser='INSERT into `2-1`(id,subcode,marks)
                                               VALUES('."'".$id."'".','
                                               ."'".$subrow['subcode']."'".','
                                               ."'".$mr."'".')';
                                              print $subrow['subcode'].'<br>';
                                         $inseresult=mysql_query($inser);
                                        if(!$inseresult)
                                          {
                                            die('invalid Query:'.mysql_error());
                                           }
                                         }
 
my problem is i want to retrieve a column from the table "2-1subjects", that contains a coumn such as
 
2-1sub#1 2-1sub#2 2-1sub#3 2-1sub#4 2-1sub#5 2-1sub#6 2-1sub#7 2-1sub#8
 
Now i want to insert the same column in same order into the table "2-1".
 
but it inserted in reverse order such as
 
2-1sub#8 2-1sub#7 2-1sub#6 2-1sub#5 2-1sub#4 2-1sub#3 2-1sub#2 2-1sub#1. I don't know the reason. please tell me and correct my code. Thanks in advance
Posted 15 Jan '13 - 16:19


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 364
1 Arun Vasu 223
2 OriginalGriff 190
3 CPallini 163
4 Aarti Meswania 158
0 Sergey Alexandrovich Kryukov 10,169
1 OriginalGriff 7,749
2 CPallini 4,181
3 Rohan Leuva 3,482
4 Maciej Los 3,089


Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid