Politics › Re: President Jonathan's Response After Card Reader Failure by neowelsh(m): 11:02am On Mar 28, 2015 |
GEJ, is back for accredictation. n'a wa for dis country |
Politics › Re: Jonathan, His Wife & Mother Now Accredited After The 4th Card Reader Was Brought by neowelsh(m): 10:45am On Mar 28, 2015 |
please note, the président and his Wife were accredicted not by the card reader but by identification. |
Politics › Re: General Buhari And His Wife Being Accredited (photos) by neowelsh(m): 9:55am On Mar 28, 2015 |
accreditation already, yet there are no INEC materials in Most community in d south, please you guys should watch channels news, for live feeds. no working card readers at the moment |
Pets › Re: Chicken Without Feathers by neowelsh(m): 9:01am On Mar 20, 2015 |
egbola infected chicken |
Forum Games › Re: Where Is The Cat In This Picture by neowelsh(m): 6:41am On Mar 08, 2015 |
inside d sink |
Politics › Re: 5 Things You Should Know About INEC's Smart Card Readers(SCRs) (PHOTO) by neowelsh(m): 11:27am On Mar 06, 2015 |
Its so funny , how We all want a free and fair election, forgetting that d easiest way to rig and election is via d card reader, all u need is change some 0s to 1s, a little change to d Codes, ure done. no sweat |
Romance › Re: Guys, What Will You Do If This Chic Slaps Your Girl? (Photo) by neowelsh(m): 8:43pm On Feb 25, 2015 |
i will turn willy willy and do what he knows how to do best. but wait, Weytin go make ur gf go find dis kind person trouble. she High? |
NYSC › Re: Nysc 2015 Batch A by neowelsh(m): 9:27am On Feb 25, 2015 |
5days indeed  |
Family › Re: Checkout How Couples Who Met At The Club Dance At Their Wedding - Photo by neowelsh(m): 11:16pm On Feb 23, 2015 |
|
NYSC › Re: Nysc 2015 Batch A by neowelsh(m): 9:41am On Feb 17, 2015 |
any latest update? |
Politics › Re: Abdullahi Babangida Muhammed Tears PDP Membership Card OBJ Way by neowelsh(m): 9:34am On Feb 17, 2015 |
illiteracy at its peak |
|
Webmasters › Re: Help, Cant Insert Data Into MYSQL Database Table by neowelsh(op): 4:51pm On Dec 04, 2014 |
maekhel: whats the exact error you are getting query failed is the error i got, which is the error echoed is the data are not inserted into the database, am believing that, the concatenation between the course code and the check box is not working. have you done any work on course registration before? |
Webmasters › Re: Help, Cant Insert Data Into MYSQL Database Table by neowelsh(op): 2:58pm On Dec 04, 2014 |
hello Mr. maekhel thanks for your reply, however have tried the code but yet got the same error. what do you think might be wrong? |
Webmasters › Re: Help, Cant Insert Data Into MYSQL Database Table by neowelsh(op): 1:46pm On Dec 03, 2014 |
neowelsh: Thank you very much for your replies, below are the codes with screen shots. the first one is is the page where a student is suppose to select his/her level, followed is the script. 1. <table> <tr> <td><strong>SURNAME:</strong></td> <td><?php echo $lastname?></td> <td><strong> OTHERNAMES:</strong></td> <td><?php echo $othername?></td></tr> <tr><td></td></tr> <tr> <td><strong>MATRIC NUMBER:</strong></td> <td><?php echo $matno?></td> <form action="Precourse_reg.php" method="post"> <td> <label><strong>SESSION:</strong> <select name="session" id="sesion"> <option selected>Select...</option> <option>2009/2010<option> <option>2010/2011</option> <option>2011/2012</option> <option>2012/2013</option> <option>2013/2014</option> <option>2014/2015</option> </select></label></td></tr> <tr><td><label><strong>LEVEL:</strong> <select name="level" id="level"> <option selected>Select...</option> <option>100</option> <option>200</option> <option>300</option> <option>400</option> <option>500</option> <option>500+</option> </select></label> </td> <td><input type="submit" name="submit" value="SUBMIT"/></td></tr></form> BELOW IS WHAT HAPPEN HAS SOON AS YOU SELECT YOUR LEVEL AND SESSION <form action="performreg.php" method="post"> <table><tr> <td><strong>SURNAME:</strong></td><td><label id="lastname" name="lastname"><?php echo $lastname ?></label></td><td> </td><td><strong>OTHERNAMES:</strong></td><td id="othername"><label id="othername" name="othername"><?php echo $othername ?></label></td></tr> <tr> <td><strong>MATRIC NUMBER:</strong></td><td><input type="text" id="matno" name="matno" value="<?php echo $matno ?>"></td><td> </td><td><strong>SESSION:</strong></td><td><input type="text" id="session" name="session" value="<?php echo $session ?>"></td></tr> <tr> <td><strong>LEVEL:</strong></td><td id="level"><input type="text" id="level" name="level"value="<?php echo $level ?> "></td></tr> <tr></tr> </table> <?php $asql = mysql_query("SELECT courses.CourseCode, courses.CourseTitle, courses.CourseUnit, courses.CourseStatus, courses.SemesterTaken, lecturer.Title, lecturer.Firstname, lecturer.Lastname FROM courses LEFT JOIN lecturer ON courses.LecturerID = lecturer.LecturerID WHERE courses.Level = '$level'" ; echo "<table border='2'><tr ><th>COURSE TITLE</th><th >COURSE UNIT</th><th>COURSE STATUS</th><th>SEMESTER TAKEN</th><th>COURSE CODE</th></td></tr>"; while ($the = mysql_fetch_array($asql)){ echo "<tr>"; echo "<td>" .$the['CourseTitle']. "</td>"; echo "<td>" .$the['CourseUnit']. "</td>"; echo "<td>" .$the['CourseStatus']. "</td>"; echo "<td >" .$the['SemesterTaken']. "</td>"; echo "<td height='7'>".$the['CourseCode']. "<input name='coursecode' id='coursecode' type='checkbox' />1". "</td>"; echo "</tr>"; } echo "</table>"; echo "<table align='right'><tr><td width = '95'> <input type='submit' name='submit' value='REGISTER'/> </td></tr></table>"; ?> </form>
PHP SCRIPT
<?php session_start(); $EE = mysql_connect("localhost", "root" , "" ; if(!$EE){ die("cannot connect to database: ".mysql_error()); } mysql_select_db("project",$EE); ?> <?php $matno = $_POST['matno']; $session = $_POST['session']; $level = $_POST['level'];
$sql = "INSERT INTO register(Matno, CourseCode, Level) VALUES ('$matno','$session','$level')";
if (mysql_query($sql,$EE)) { echo '<script type="text/javascript">alert("Query Successful, add another student" ;window.location=\'addcourses.php\';</script>'; } else echo"query failed"; mysql_close($EE);
?>
THANKS neowelsh: Thank you very much for your replies, below are the codes with screen shots. the first one is is the page where a student is suppose to select his/her level, followed is the script. 1. <table> <tr> <td><strong>SURNAME:</strong></td> <td><?php echo $lastname?></td> <td><strong> OTHERNAMES:</strong></td> <td><?php echo $othername?></td></tr> <tr><td></td></tr> <tr> <td><strong>MATRIC NUMBER:</strong></td> <td><?php echo $matno?></td> <form action="Precourse_reg.php" method="post"> <td> <label><strong>SESSION:</strong> <select name="session" id="sesion"> <option selected>Select...</option> <option>2009/2010<option> <option>2010/2011</option> <option>2011/2012</option> <option>2012/2013</option> <option>2013/2014</option> <option>2014/2015</option> </select></label></td></tr> <tr><td><label><strong>LEVEL:</strong> <select name="level" id="level"> <option selected>Select...</option> <option>100</option> <option>200</option> <option>300</option> <option>400</option> <option>500</option> <option>500+</option> </select></label> </td> <td><input type="submit" name="submit" value="SUBMIT"/></td></tr></form> BELOW IS WHAT HAPPEN HAS SOON AS YOU SELECT YOUR LEVEL AND SESSION <form action="performreg.php" method="post"> <table><tr> <td><strong>SURNAME:</strong></td><td><label id="lastname" name="lastname"><?php echo $lastname ?></label></td><td> </td><td><strong>OTHERNAMES:</strong></td><td id="othername"><label id="othername" name="othername"><?php echo $othername ?></label></td></tr> <tr> <td><strong>MATRIC NUMBER:</strong></td><td><input type="text" id="matno" name="matno" value="<?php echo $matno ?>"></td><td> </td><td><strong>SESSION:</strong></td><td><input type="text" id="session" name="session" value="<?php echo $session ?>"></td></tr> <tr> <td><strong>LEVEL:</strong></td><td id="level"><input type="text" id="level" name="level"value="<?php echo $level ?> "></td></tr> <tr></tr> </table> <?php $asql = mysql_query("SELECT courses.CourseCode, courses.CourseTitle, courses.CourseUnit, courses.CourseStatus, courses.SemesterTaken, lecturer.Title, lecturer.Firstname, lecturer.Lastname FROM courses LEFT JOIN lecturer ON courses.LecturerID = lecturer.LecturerID WHERE courses.Level = '$level'" ; echo "<table border='2'><tr ><th>COURSE TITLE</th><th >COURSE UNIT</th><th>COURSE STATUS</th><th>SEMESTER TAKEN</th><th>COURSE CODE</th></td></tr>"; while ($the = mysql_fetch_array($asql)){ echo "<tr>"; echo "<td>" .$the['CourseTitle']. "</td>"; echo "<td>" .$the['CourseUnit']. "</td>"; echo "<td>" .$the['CourseStatus']. "</td>"; echo "<td >" .$the['SemesterTaken']. "</td>"; echo "<td height='7'>".$the['CourseCode']. "<input name='coursecode' id='coursecode' type='checkbox' />1". "</td>"; echo "</tr>"; } echo "</table>"; echo "<table align='right'><tr><td width = '95'> <input type='submit' name='submit' value='REGISTER'/> </td></tr></table>"; ?> </form>
PHP SCRIPT
<?php session_start(); $EE = mysql_connect("localhost", "root" , "" ; if(!$EE){ die("cannot connect to database: ".mysql_error()); } mysql_select_db("project",$EE); ?> <?php $matno = $_POST['matno']; $session = $_POST['session']; $level = $_POST['level'];
$sql = "INSERT INTO register(Matno, CourseCode, Level) VALUES ('$matno','$session','$level')";
if (mysql_query($sql,$EE)) { echo '<script type="text/javascript">alert("Query Successful, add another student" ;window.location=\'addcourses.php\';</script>'; } else echo"query failed"; mysql_close($EE);
?>
THANKS after ticking all the courses to be registered and click on register, i expect the courses to be saved to a table in the database, titled register, below is a diagram of the register table.
|
Webmasters › Re: Help, Cant Insert Data Into MYSQL Database Table by neowelsh(op): 1:29pm On Dec 03, 2014 |
Thank you very much for your replies, below are the codes with screen shots. the first one is is the page where a student is suppose to select his/her level, followed is the script. 1. <table> <tr> <td><strong>SURNAME:</strong></td> <td><?php echo $lastname?></td> <td><strong> OTHERNAMES:</strong></td> <td><?php echo $othername?></td></tr> <tr><td></td></tr> <tr> <td><strong>MATRIC NUMBER:</strong></td> <td><?php echo $matno?></td> <form action="Precourse_reg.php" method="post" > <td> <label><strong>SESSION:</strong> <select name="session" id="sesion"> <option selected>Select...</option> <option>2009/2010<option> <option>2010/2011</option> <option>2011/2012</option> <option>2012/2013</option> <option>2013/2014</option> <option>2014/2015</option> </select></label></td></tr> <tr><td><label><strong>LEVEL:</strong> <select name="level" id="level"> <option selected>Select...</option> <option>100</option> <option>200</option> <option>300</option> <option>400</option> <option>500</option> <option>500+</option> </select></label> </td> <td><input type="submit" name="submit" value="SUBMIT"/></td></tr></form> BELOW IS WHAT HAPPEN HAS SOON AS YOU SELECT YOUR LEVEL AND SESSION<form action="performreg.php" method="post"> <table><tr> <td><strong>SURNAME:</strong></td><td><label id="lastname" name="lastname"><?php echo $lastname ?></label></td><td> </td><td><strong>OTHERNAMES:</strong></td><td id="othername"><label id="othername" name="othername" ><?php echo $othername ?></label></td></tr> <tr> <td><strong>MATRIC NUMBER:</strong></td><td><input type="text" id="matno" name="matno" value="<?php echo $matno ?>"></td><td> </td><td><strong>SESSION:</strong></td><td><input type="text" id="session" name="session" value="<?php echo $session ?>"></td></tr> <tr> <td><strong>LEVEL:</strong></td><td id="level"><input type="text" id="level" name="level"value="<?php echo $level ?> "></td></tr> <tr></tr> </table> <?php $asql = mysql_query("SELECT courses.CourseCode, courses.CourseTitle, courses.CourseUnit, courses.CourseStatus, courses.SemesterTaken, lecturer.Title, lecturer.Firstname, lecturer.Lastname FROM courses LEFT JOIN lecturer ON courses.LecturerID = lecturer.LecturerID WHERE courses.Level = '$level'"  ; echo "<table border='2'><tr ><th>COURSE TITLE</th><th >COURSE UNIT</th><th>COURSE STATUS</th><th>SEMESTER TAKEN</th><th>COURSE CODE</th></td></tr>"; while ($the = mysql_fetch_array($asql)){ echo "<tr>"; echo "<td>" .$the['CourseTitle']. "</td>"; echo "<td>" .$the['CourseUnit']. "</td>"; echo "<td>" .$the['CourseStatus']. "</td>"; echo "<td >" .$the['SemesterTaken']. "</td>"; echo "<td height='7'>".$the['CourseCode']. "<input name='coursecode' id='coursecode' type='checkbox' />1". "</td>"; echo "</tr>"; } echo "</table>"; echo "<table align='right'><tr><td width = '95'> <input type='submit' name='submit' value='REGISTER'/> </td></tr></table>"; ?> </form> PHP SCRIPT<?php session_start(); $EE = mysql_connect("localhost", "root" , ""  ; if(!$EE){ die("cannot connect to database: ".mysql_error()); } mysql_select_db("project",$EE); ?> <?php $matno = $_POST['matno']; $session = $_POST['session']; $level = $_POST['level']; $sql = "INSERT INTO register(Matno, CourseCode, Level) VALUES ('$matno','$session','$level')"; if (mysql_query($sql,$EE)) { echo '<script type="text/javascript">alert("Query Successful, add another student"  ;window.location=\'addcourses.php\';</script>'; } else echo"query failed"; mysql_close($EE); ?> THANKS
|
Webmasters › Help, Cant Insert Data Into MYSQL Database Table by neowelsh(op): 3:10pm On Dec 02, 2014 |
hello webmasters, Merry Xmas in advance. Am developing a mini project(kind of course registration portal) for my department, where all the courses, are on a table in the database, in other to register this courses, a student must select a level, depending on the level selected, courses are retrieved from the database.
this is where my problem starts, have been able to display all the courses from the database on a page, but could not insert the ticked courses into the register table on the database, please i need help.
should i paste my codes? i think am getting something wrong.
thanks in Advance |
Webmasters › Re: How Can I Make My Forum Board/topic Board Like NL by neowelsh(m): 6:45am On Oct 12, 2014 |
after installing smf, look for this mod, tinyPortal, It will enable u edit Ur Board, d way u want It to be. Good luck. |
Webmasters › Re: Drop Your Twitter Handles Here. by neowelsh(m): 5:04pm On Jan 07, 2014 |
|
Webmasters › Re: Drop Your Facebook Fan Page And Get More Likes by neowelsh(m): 8:19am On Dec 28, 2013 |
|
Webmasters › Re: This Is My First Hosted Website, What Do You Think? by neowelsh(op): 5:39pm On Dec 24, 2013 |
Iam_Godzilla: Please what hosting service did you use? whogohost.com |
Webmasters › Re: I Want An Smf Forum Developer Urgently by neowelsh(m): 5:35pm On Dec 24, 2013 |
|
Programming › Re: How Do I Solve Error On Myphp Line Code? by neowelsh(m): 10:28am On Dec 22, 2013 |
Freenobleman@yahoo.com: ok let me try it but now we don't have light now no troublem, just keep us posted |
Programming › Re: How Do I Solve Error On Myphp Line Code? by neowelsh(m): 9:41am On Dec 22, 2013 |
try this <?php $main_path = "C:\xampp\htdo"; $include_path = "C:\xampp\h"; ?> i hope it help |
Webmasters › Re: This Is My First Hosted Website, What Do You Think? by neowelsh(op): 1:54pm On Dec 21, 2013 |
Afam4eva: What i mean is that you should plan the structure of your site before you commence. may i know what you used in designing. Did you code the html or did you use Dreamweaver or related software? coded a little and completed it with Dreamweaver |
Webmasters › Re: This Is My First Hosted Website, What Do You Think? by neowelsh(op): 10:30am On Dec 21, 2013 |
what do you advice i use for the watchword |
Webmasters › Re: This Is My First Hosted Website, What Do You Think? by neowelsh(op): 10:21am On Dec 21, 2013 |
Afam4eva: It's commendable for a web design noob but i think you can do better. I think your watchword has to be "the simpler the better". Everything looks clogged to me and it will be a turn off for visitors. thanks for your advice |
Webmasters › This Is My First Hosted Website, What Do You Think? by neowelsh(op): 10:14am On Dec 21, 2013 |
Compliment of the season, Guru's in the house please help me rate this website. i will appreciate any advice from you guys thanks www.studentofnaija.com |
Programming › Re: Nairaland Whatsappp Group by neowelsh(m): 8:30am On Nov 21, 2013 |
08034447193 |
Education › Re: ASUU May Suspend Strike Today by neowelsh(m): 5:14pm On Nov 16, 2013 |
i hope something good comes out
|
Education › Are You In Support Of ASUU? YES/NO, Give Reasons For Your Answers by neowelsh(op): 11:33pm On Oct 15, 2013 |
Happy Eid Ul Kabir to everyone, am sorry for bring another ASUU post, am just curious, it seems so many student are in support of this ASUU of a thing and I wonder why, hence the topic. Initially I used to support them, not until I read an interview on this forum where the ASUU chairman said their demands is 3 trillion Naira, that, they won’t accept the 130 billion Naira given to them by the federal government. I was  shocked, how can anyone in his/her right mind demand for such a ridiculous amount? What do they need this money for? Will it stop the lecturers from extorting money from students, inform of handout and organizing of unnecessary tutorials in school? 99% of lecturers uses one/the same lecture material for more than 10 years without adding an A or remove a B from it, will this money enable them to update their lecture notes? It’s a shame when I hear some of us supporting this sick people called ASUU, what have they done to improve education in this country, absolutely nothing, they only care about enriching their pocket. They are lucky am not the president of this country, I would have sacked all of them. I could remember when doctors in Delta State went on strike, the governor just sacked them, and they came running back, begging. My brothers and sisters, are you in support of this strike? Please give reasons. |
Webmasters › Re: I Need Someone To Design A Free Website For Me Please by neowelsh(m): 7:38pm On Sep 05, 2013 |
give me the details, might be able to help since you have a domain and hosting account |