Results 1 to 4 of 4

Thread: What i do ?

  1. #1
    Join Date
    Jun 2008
    Location
    pakistan
    Posts
    109

    Unanswered: What i do ?

    I wanna ask that i have make a student fee collection using php/mysql

    i want to ask that i have to collect each student fee using his code number(employe number) current month fee will be shown but how can i do that if a student doesn't submit his last month fee some thing like that he submit the fee of january then doesn't submit feburary and he is standing in the month of march how can it show that the student of code number 200 doesn't submit the fee of last month feburary ....

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    So you're using MySQL, right?

    Please provide table definition(s) (in the form of CREATE TABLE statements), some sample data (in the form of INSERT statements) and the output you'd like from your query.
    George
    Home | Blog

  3. #3
    Join Date
    Jun 2008
    Location
    pakistan
    Posts
    109
    ok tell me this one query then i will show you some data
    std_inf has only 1 column name std_code number(8)

    PHP Code:
    insert into std_inf values((select from std_info where std_class=10)); 
    it says sub query returns more than one row cause std_class 10 has 4 student in class 10 i want to put his code number in the table std_inf

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    do not include both VALUES and SELECT in an INSERT statement
    Code:
    INSERT 
      INTO std_inf 
    SELECT std_code  
      FROM std_info 
     WHERE std_class = 10
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •