Jump to content

EzwanAbid

Members
  • Posts

    39
  • Joined

  • Last visited

About EzwanAbid

  • Birthday 12/15/1992

Profile Information

  • Gender
    Male
  • Age
    20

EzwanAbid's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi guys, i had a problem with drop down menu. I want to have an input option to be inserted into the select statement. How can I do that, please help me…i need to create another site that is "Add Semester". So, this site will add on new semester inside the drop down menu. this is the html for drop down menu that i'd made. First of all, should i give value in <option value="xxx">?? Second, how about the sql statement? I got stuck to create the php code. <select type="listbox" name="semester" id="semester"> <option>2011/JANUARY</option> <option>2011/JUNE</option> <option>2011/SEPTEMBER</option> <option>2012/JANUARY</option> <option>2012/JUNE</option> <option>2012/SEPTEMBER</option> <option>2013/JANUARY</option> </select> Pls Help me :'(
  2. Ah, forgot to ask you,, can 1 Foreign key value have more than 1 data of row by using the same 1 Foreign Key value : Examples : Student table : student_id (PK ) [with value 05-201005-00018] surat table : 1. student_id (FK) [with value 05-201005-00018] + [type_of_letter= TamatBelajar] 2. student_id (FK) [with value 05-201005-00018] + [type_of_letter= ExamAkhir ] What I mean here, 1 value from PK, then we use the same PK=FK value but have different data in 'surat' table that is the data in the 'type_of_letter' column.. because 1 student may request more than 1 kind of letter.
  3. Thank you Christian F for your reply.. Yes, that's the problem .. I can't just use POST and GET to receive selected student data into word document, or maybe my code are wrong.. Is there any solution that I can use to bring selected student data into word document? That's my biggest problem now.
  4. I'm having a problem here which I don't know how to bring data that pass by url and send to PHPWord, so that the passed value can be use as data in my PHPWord.. My system will be accessed by lots of user, and I want to bring the current student info after I click "generate letter" that locate bottom of the queue list for each person.. The data that I want from webpage is : fullname, student_id, ic_number, course, After clicking the "Generate Letter", the PHPWord will print the data according to the selected student in the list : (example) student name = Ezwan Abid student_id = 05-201005-00018 ic_number = 12-121212-1212 course = IT - Software and all those data above ( from the 'queue' list html page ) will bring the data to PHPWord and be printed. Hope someone can help me ASAP. :-\ I already upload the file that contain the code : ApprovedLetter.php = Display the student data that already request a certain letter. The data will be display in table as queue list. KebenaranProjek-code.php = PHPWord code that contain mysql to bring data from database. KebenaranProjek-code.php ApprovedLetter.php
  5. i tried to insert 'semester' value into specific column in table 'register' inside my database/phpmyadmin... But after I submit the value, it doesn't bring the data into the table .. so the column of 'semester' was empty without any values. Here the code for inserting data/value into 'semester' column inside 'register' table : <?php $reg_id=$_GET['reg_id']; $stud_id=$_POST['IDUSER']; $sub_code=$_GET['sub_code']; $semester=$_GET['semester']; $aDoor = $_POST['formDoor']; if(empty($aDoor)) { echo("<h2>You didn't select any subject.</h2>"); } else { $N = count($aDoor); echo("<h2>You selected $N subject(s): </h2><br><br>"); mysql_connect ("localhost","",""); mysql_select_db ("projek"); for($i=0; $i < $N; $i++) { $subject=$aDoor[$i]; $stuff = mysql_query("SELECT sub_code FROM `register` WHERE stud_id='".$stud_id."' AND sub_code='".$subject."'") or die("MySQL Login Error: ".mysql_error()); if (mysql_num_rows($stuff) > 0) { $row=mysql_fetch_array($stuff); echo '<br><br><h2>Fail register </h2>' ; echo $row['sub_code']; } else if (mysql_num_rows($stuff) <= 0) { $sql_insert="INSERT INTO register(reg_id,stud_id,sub_code,semester) VALUES('$reg_id','$stud_id','$subject','$semester')"; $result=mysql_query($sql_insert); echo '<br><br>Success register'; echo($aDoor[$i] . " "); } } } ?> Hope someone can help me here.. I'm new in PHP and MySQL .
  6. Thank you for your reply kicken .. Thx it's working ! I never thought it would be a problem when I'm doing like that.. Thank you again kicken. My problem are SOLVED.
  7. Why my '0' value didn't display in phpmyadmin? Example : The value I send from HTML is "05-201005-00018" but.. inside my phpmyadmin table the value turn into like this "05-201005-18" Here the picture of my database structure for student table : And here my PHP file where the value need to be inserted. StudentReg.html StudentReg.php Hope someone can help me here
  8. Yes ! They no longer display the result twice.. Thank you for teach me guy... Now I've already learn how use var_dump and some knowledge about SQL Join Query ... Thank you very much ! It really working and I'm so happy you guys can help me ASAP.. I'm really appreciate that because I need to get this work done less in 4 days. .The problem is SOLVED. !
  9. Thank you for your help. but did you just set a new variable/name for student as 'st' ? and surat as 'su'? in that query? Why must we do so?
  10. Yes but still I need data from admin table .. so I need another query? Seriously I'm not that good in MySQL code.. so can I use this 1 and just insert it into my code? $newsql=("SELECT *FROM admin WHERE adminfullname,department"); $newresult=mysql_query($newsql);
  11. Thank you for reply me Christian, admin doesn't have any relationship from student and surat table.. ermm :-\
  12. aw I forgot to tell that 1..sorry for that.. Table : admin PK : adminid Table : student PK : student_id Table : surat PK : id_surat FK : student_id
  13. the result I want is to get data and display : Table : admin Column needed : adminfullname , department Table : student Column needed : student_id, fullname, ic_number, course, Table : surat Column needed : id_surat, jenissurat What I'm trying to do here is to display all the data that waiting for the "Letter Process" .. This system is about the "Letter Generator System" which it will bring the data from database and send into Microsoft Word template to be processes.
  14. Thank you for replying DavidAM, ok I try this code var_dump ($result); and after that I get this output resource(4) of type (mysql result) resource(4) of type (mysql result) can someone tell me the correct code to "join the condition" like $sql="SELECT * FROM student,surat,admin WHERE student.student_id=surat.student_id"; actually, I'm just a newbie in PHP and MySQL .. some of the code above I take from website and some I make it myself base on tutorials. I don't understand the code "student.student_id=surat.student_id" .. what is the meaning of this code?
  15. Thank for your reply.. How to make those var_dump? I already try to learn from certain tutorial about var_dump.. and I not really understand how to do it. Yes, I only need to 'join up' student and surat table which the data I want is only student_id.. the others data from admin and surat table I don't think I need to combine both of them because I need to display almost all of the data inside both table.
×
×
  • 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.