Jump to content

TheJuan

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TheJuan's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi i run the query: SELECT * (SELECT id FROM members m WHERE orgid = '1') m1 INNER JOIN members m2 ON m1.id = m2.id INNER JOIN organization o ON m2.orgid = o.orgid ORDER BY m2.id, m2.orgid; ---Here is the error message--- Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(SELECT id FROM members m WHERE orgid = '1') m1 INNER JOIN members m2 ON m1.id =' at line 2 i get and make orgid = 1 -- still i cannot make it work -- Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(SELECT id FROM members m WHERE orgid = 1) m1 INNER JOIN members m2 ON m1.id = m' at line 2 help is greatly appreciated
  2. thank you for your time, but that is not what i would like to generate here are my tables tbl.members : id givenname middleinitial familyname orgID remarks tbl.organization : orgID name incharge phone what i would like to make is a report regarding name of students who is a member of a centain organization and at the same time list the other organization where he/she affiliate sample: memberID = 1 ; orgID = 1 memberID = 1 ; orgID = 2 memberID = 2 ; orgID = 1 memberID = 2 ; orgID = 3 memberID = 3 ; orgID = 2 memberID = 3 ; orgID = 3 memberID = 3 ; orgID = 4 memberID = 4 ; orgID = 1 memberID = 5 ; orgID = 6 memberID = 5 ; orgID = 3 memberID = 5 ; orgID = 4 memberID = 7 ; orgID = 1 memberID = 7 ; orgID = 3 memberID = 7 ; orgID = 4 when run the query with orgID = 1 this will give a result memberID : 1 ; orgID : 1 memberID : 1 ; orgID : 2 << because he also belong to orgID=1 memberID : 2 ; orgID : 1 memberID : 2 ; orgID : 3 << because he also belong to orgID=1 memberID : 4 ; orgID : 1 memberID : 7 ; orgID : 1 << because he also belong to orgID=1 memberID : 7 ; orgID : 3 << because he also belong to orgID=1 memberID : 7 ; orgID : 4 << because he also belong to orgID=1
  3. Please help. I would like to build a list of all students with their different organization(s). Every organization representatives would submit their list with this field: Firstname, Familyname, Middle Initial, OrganizationID. How can I list the students in an organization with single and/or multiple memberships?
  4. I searched and searched but could not find a idea that can light me. if anyone point me to article or tutorial on this would be appreciated. i have two input textbox for dates, one is date borrowed which from date picker calendar 07/21/2009 and what i would like to make is the second textbox would be auto compute for X months the second input textbox would automatic display a value 01/21/2010 if i assign a 6 months variable more power.
  5. thanks for the reply i thought trim() removes all whitespace characters from both the left and right ends of a string. what i would like to make is to add a whitespace to a variable firstname, lastname that could make it a 15charachter data field stored in mysql. greatly appreciated
  6. hi im wondering if PHP is capable of inserting fix character length in mysql field, and how it be possible or could point me to a article/tutorial related to this. sample. i have a textbox > Firstname: Glenn Lastname: Mission after i submit this data, mysql store this to fld_firstname, fld_lastname as 15 varchar length adding a blank space to the rightside to make it a 15 characters in total i have done forum search and web search but with no luck. more power
  7. hi i really spent my time on this one. everything is fine with out this line: WHERE (tblinitemdetail.QuantityIn - SUM(tblrequestdetail.QuantityOut)) <= '10'
  8. hi i have here a form which a result query from database. i would like to execute a script which insert to another table, those data with a check can only be inserted. my problem is that when i check the first 2, skip two data, and check the last data, i get the first 3 data. still the same when i check the 1st, skip 2nd,3rd,4th, check the last, i still get the first 2 data which is wrong. hope i make it clear. here is the form <form method='POST' action='add.php'> <table border='0' width='100%' class='kylin'> <tr> <th width='6%'>Add</td> </tr> <tr> <td> <input type='text' readonly value='LSO13' name='xsocode[]'></td> <td width='3%'><input type='checkbox' name='check_block[]' value='check_block' checked></td> </tr> <tr> <td> <input type='text' readonly value='LSO15' name='xsocode[]'></td> <td width='3%'><input type='checkbox' name='check_block[]' value='check_block' checked></td> </tr> <tr> <td> <input type='text' readonly value='LSO17' name='xsocode[]'></td> <td width='3%'><input type='checkbox' name='check_block[]' value='check_block' checked></td> </tr> <tr> <td> <input type='text' readonly value='LSO71' name='xsocode[]'></td> <td width='3%'><input type='checkbox' name='check_block[]' value='check_block' checked></td> </tr> <tr> <td> <input type='text' readonly value='LSO16' name='xsocode[]'></td> <td width='3%'><input type='checkbox' name='check_block[]' value='check_block' checked></td> </tr> </table> <input type='submit' value='Submit' name='submit'> <input type='hidden' value='set'name='pasalog' /> <input type='hidden' value='04-05607' name='xstudentno'> <input type='hidden' value='vincent' name='user'> </p> </form> here is my code for add.php $vsocode = $_POST['xsocode']; $vstudentno = $_POST['xstudentno']; $vuser = $_POST['user']; $vdate = date('m-d-Y'); $vtime = date('h:i:s A'); $kylin = $_POST['check_block']; if (isset($_POST['pasalog'])) { foreach ($kylin as $key => $value) { $query = " INSERT INTO subjects_enrolled_tbl SET studentno = '$vstudentno', subjectenrolled = '$vsocode[$key]', encoder = '$vuser', dateentered = '$vdate', timeentered = '$vtime'; "; print $key . "-" . $query . "<br/>"; } }
  9. hi i just wondering how can it be possible to make a query of this situation. I have a list of student name in tbl_students and a table tbl_payments where stored a list of students(id,name,amount) who already pay for a fee. i want to display those all name of students that are in tbl_students but not yet in tbl_payments something like: select id,name from tbl_student where id is not present in tbl_payments thanks
×
×
  • 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.