I want to print the username on jsp page"**success.jsp**" from "**home.jsp**" i have used **hibernate** to save data in table . "home.jsp" <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <center> <h1 ><font color="red">User-Interface</font></h1> <form action=loginServlet method="post"> <table border="1" bordercolor="red" style="border-style: dotted;" cellpadding="5px" cellspacing="10px"> <tr> <td>UserName:</td><td><input type="text" name="username"></td> </tr> <tr> <td>Password:</td><td><input type="password" name="password"></td> </tr> </table> <input type="submit" value="Log-In" > </form> New User?<a href="register.jsp"> Register Here</a> </center> </body> </html> success.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> …

Member Avatar
+0 forum 0

I am trying to select all rows from all tables in the database when a column equal a given name. I have like many tables with same structure and columns. I have written this piece of code but it throws an error. SELECT GROUP_CONCAT(qry SEPARATOR ' UNION ') INTO @sql FROM ( SELECT CONCAT('SELECT * FROM `',table_name,'` where Name like ''','sally%','''') qry FROM ( SELECT distinct table_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'db_customers' AND column_name LIKE 'Name' ) A ) B; PREPARE s FROM @sql; EXECUTE s; DEALLOCATE PREPARE s; This is the error I am getting. I am aware …

Member Avatar
Member Avatar
+0 forum 3

Hey everyone i am just asking for a little bit off help if thats fine how can i make 11 fetch scripts into 1 script please [database ](https://i.imgur.com/BTGQF1P.png) i like to make this menu to display the coins i know you can do it but i dont know how since am not pro <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist"> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Pick a coin</a> <div class="dropdown-menu"> <a class="dropdown-item" id="pills-btc-tab" href="#pills-btc" role="tab" data-toggle="pill" aria-controls="pills-btc"><img src="https://i.imgur.com/h2bZxBg.png" width="23" height="23"> Bitcoin</a> </div> </ul> fetch from mysqli i have btc here but i like to get every …

Member Avatar
+0 forum 0

How can I find the parent tr from the closest child tr e.g. from the second child tr, how can I get to the first parent tr? Below is the html table: <table> <tr class="menu"> <td><input type='text' class='parent' value='First Parent'></td> </tr> <tr class="submenu"> <td><input type='text' class='child' value='First Child'> </td> </tr> <tr class="submenu"> <td><input type='text' class='child' value='Second Child'> </td> </tr> <tr class="menu"> <td><input type='text' class='parent' value='Second Parent'></td> </tr> <tr class="submenu"> <td><input type='text' class='child' value='First Child'> </td> </tr> </table> I have tried the following JQuery code: $(this).closest('tr.submenu').closest('tr.menu').find('.parent').val(); $(this).closest('tr.submenu').parent('tr.menu').find('.parent').val(); $(this).closest('tr.menu').find('.parent').val(); $(this).closest('tr.submenu').prevUntil('tr.menu').find('.parent').val(); $(this).closest('tr.submenu').parentsUntil('tr.menu').find('.parent').val(); $(this).closest('tr.submenu').parents(':first-child').find('.parent').val(); All attempts have failed. How can I get the parent …

Member Avatar
Member Avatar
+1 forum 3

I have two tables like below tb1 Date Cr Dr 2018-04-29 100 50 2018-04-30 0 150 2018-05-01 250 100 2018-05-02 150 100 2018-06-10 300 250 2018-06-11 0 50 tb2 Date Cr 2018-05-01 350 2018-05-02 250 2018-06-10 300 2018-06-11 100 2018-06-15 200 2018-06-18 100 I need the following Result Apr May Jun Cr 100 1000 1000 Dr 200 200 300 Basically I have to add the respective Cr columns from both table and get the Dr from tb1 for the corresponding dates and create a monthly report. I have tried SELECT Date(tb1.Date) as sDate, SUM(tb1.Cr+tb2.Cr) sumcr, SUM(tb1.Dr) sumdr FROM tb1,tb1 WHERE …

Member Avatar
Member Avatar
+0 forum 7

Hey guys. So this should be a pretty simple question (but doesn't appear to be) that I'm hoping some of the database wizards out there can help me with. I'm not too long outta university with a BSC in Computing, I didn't get a full classification due to the fact that yup I failed the Data Management module. I was never very good with normalization and splitting a database down into the correct amount of tables and relationships. Anyway I've been asked to produce a simple web site (first paid project) for a fish and chips take away down the …

Member Avatar
Member Avatar
+0 forum 5

Hi I am struggling how to list all the permissions and with checkboxes. if anyone can help me with it this is the code echo "<table cellpadding='0' cellspacing='0' width='100%' class='table table-bordered'>"; echo "<tr>"; echo "<th>PERMISSION</th>"; foreach($user_groups->rows as $row) { echo "<th class='checkbox'>".$row['title']."</th>"; } echo "</tr>"; $users_permission_query = $this->db->query("SELECT * FROM users_permission"); foreach($users_permission_query->rows as $row) { $group_permissions_rows = json_decode($row['permission'], TRUE); echo "<tr>"; echo "<td>".$row['module']."<br />"; foreach($group_permissions_rows as $key => $value) { echo "{$key}<br>"; } echo "</td>"; echo "<td>"; echo "<table cellpadding='0' cellspacing='0' width='100%'>"; for($i=0; $i < count($group_permissions_rows); $i++) { foreach($group_permissions_rows as $key => $value) { echo "<tr>"; echo "<td><input type='checkbox' name='permissions[" …

Member Avatar
Member Avatar
+0 forum 4

Hello, i success display all the record when the button clicked <html> <head lang="en"> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="bootstrap-3.2.0-dist\css\bootstrap.css"> <!--css file link in bootstrap folder--> <title>View Users</title> </head> <style> .login-panel { margin-top: 150px; } .table { margin-top: 50px; } </style> <body> <div class="table-scrol"> <h1 align="center">All the Users</h1> <div class="table-responsive"><!--this is used for responsive display in mobile and other devices--> <table class="table table-bordered table-hover table-striped" style="table-layout: fixed"> <thead> <tr> <th>kepada</th> <th>nama</th> <th>jawatan</th> </tr> </thead> <?php include('db_connection.php'); $view_users_query="select * from permohonan";//select query for viewing users. $run=mysqli_query($dbcon,$view_users_query);//here run the sql query. while($row=mysqli_fetch_array($run))//while look to fetch the result and store in a array …

Member Avatar
Member Avatar
+0 forum 2

I have 2 user which is officer and admin. The officer fill in the form. Admin will open the form, see details of officer and fill his detail. The problem is i success output all the information fill by the officer but when the admin fill the data not in the same row as officer data in database. Here my code: lihatpemohon.php: <?php session_start(); include('db_connection.php'); $view_id=$_GET['get']; $view_query="SELECT * FROM permohonan WHERE id='$view_id'"; $run=mysqli_query($dbcon,$view_query); while($row=mysqli_fetch_array($run)) { echo"Kepada :<input type='text' name='kepada' value='".$row['kepada']."' /><br><br>"; echo'<br>Tuan,<br> <b><h4>MEMOHON KEBENARAN MENINGGALKAN PEJABAT OLEH PEGAWAI/KAKITANGAN BAHAGIAN TEKNOLOGI PENDIDIKAN NEGERI PERAK DAN RANGKAIAN</h4></b><br>'; echo"Saya : <input type='text' name='nama' …

Member Avatar
Member Avatar
+0 forum 2

I have two tables. MODELS and AUTOMOBILES. And procedure which export all models with name that user inputs and their price(stored in AUTOMOBILES). create or REPLACE procedure modelzz( VAR_MODEL IN MODELS.NAME_MODEL%TYPE, VAR_PRICE OUT AUTOMOBILES.A_PRICE%TYPE ) as begin SELECT a.A_PRICE INTO VAR_PRICE FROM AUTOMOBILES a join MODELS m on a.MODELS_ID_MODEL=m.ID_MODEL where m.NAME_MODEL=VAR_MODEl; dbms_output.put_line(VAR_MODEL||'''s price is : '||VAR_PRICE); procedure start: var v_modelzz varchar2; exec modelzz('&model_name',:v_modelzz); The problem is I want to export all records for certain model. Their's more than one, one model can have two or more records. Here's the error: **exact fetch returns more than requested number of rows**

Member Avatar
Member Avatar
+0 forum 5

Hi I am working on a payroll project and I am coding with php,html,js and mysql on xampp server. I have a salary sheet code which needs to be printed in pdf format for each employee with their names as the pdf filename. on running the php page the js code triggers automatically and generates pdf files but the problem is the salary data of the first employee is printed on every payslip but The filename changes with every pdf. for example : 1st emp name is rajesh rao, 2nd emp name is a.ghosh. now when I print the sheets, …

Member Avatar
Member Avatar
+0 forum 4

Hello, I'm not able to display the whole select result information in the table and I have no idea what I am doing wrong, I would appreciate your help so much. So here's my code: <?php $DBServer = 'localhost'; $DBUser = 'root'; $DBPass = ''; $DBName = 'world'; $conn = new mysqli($DBServer, $DBUser, $DBPass, $DBName); $sql = "SELECT Id, Name, CountryCode, District, Population FROM city WHERE CountryCode = 'USA'"; $result = $conn->query($sql); if($result->num_rows > 0){ echo "<table border='1'> <tr> <th>Id</th> <th>Name</th> <th>Code</th> <th>District</th> <th>Population</th> </tr>"; while($row = mysqli_fetch_array($result)){ echo" <tr> <td>".$row['Id'] ."</td> <td>".$row['Name'] ."</td> <td>".$row['CountryCode'] ."</td> <td>".$row['District'] ."</td> <td>".$row['Population'] ."</td> …

Member Avatar
Member Avatar
+0 forum 3

<div class="content" style="margin-left:17%;"> <div class="box box-warning" > <div class="box-header with-border" style="margin-left:20%;"> <h3 class="box-title">Add Package</h3> </div><!-- /.box-header --> <div class="box-body" style="margin-left:9%;"> <div class="row"> <div class="col-md-10" > <form action="" method="post" accept-charset="utf-8"> <div class="row" > <div class="col-md-6"> <div class="form-group"> <label for="varchar">Name </label> <input type="text" class="form-control" name="name" id="name" placeholder="Name" value=""> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="enum">Status </label> <select name="status" class="form-control"> <option value="active">Active</option> <option value="inactive">Inactive</option> </select> </div> </div> </div> <div class="form-group" style="margin-left:6%;" > <label for="varchar">Tests </label> <div class="table"> <table class='table table-responsive table-hover' style='margin-bottom: 10px'> </div> <?php $conn=mysqli_connect("localhost","root","","laboratory") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); $query="SELECT * FROM test"; $result=mysqli_query($conn,$query); if ($result) { while ($record=mysqli_fetch_array($result)) { …

Member Avatar
Member Avatar
+0 forum 1

hi everyone hope you are all well... i am login with userid and password and i want to display there username after login from my oracle database how?

Member Avatar
Member Avatar
+0 forum 3

hi everyone i need help in my query while user login. <?php $username = $_POST["username"]; $password = $_POST["password"]; $con = oci_connect("user","pswrd","db"); if(! $con) { die('Connection Failed'.oci_error()); } $query = "SELECT username, password FROM users WHERE username=$username"; $stmt = oci_parse($conn, $query); $row = oci_fetch_array($stmt, OCI_NUM);; if($row["username"]==$username && $row["password"]==$password) echo"You are a validated user."; else echo"Sorry, your credentials are not valid, Please try again."; ?> i got error which is that oci_fetch_array(): ORA-24374: define not done before fetch or execute

Member Avatar
Member Avatar
+0 forum 5

hi everyone hope you all are in good. i have query while login form in php with oracle database..... i want to simple login with database html code: <p> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> Username:<br /><input type="text" name="username" size="10" /><br /> Password:<br /><input type="password" name="password" size="10" /><br /> <input type="submit" value="Login" /> </form> </p> php code: <?php session_start(); if (! isset($_SESSION['username'])) { if (isset($_POST['username'])) { $username = htmlentities($_POST['username']); $password = htmlentities($_POST['password']); $conn = oci_connect('user', 'pswrd', 'db') or die("Can't connect to database server!"); $query = "SELECT username, password FROM users WHERE username=:username AND password=:password"; $stmt = oci_parse($conn, $query); oci_bind_by_name($stmt, ':username', …

Member Avatar
Member Avatar
+0 forum 1

i want to show calendar in php show in image below connected to oracle database table. ![ywub5.png](/attachments/large/4/10022dd703908aa37616b34022b15f64.png "align-center")

Member Avatar
Member Avatar
+0 forum 2

hi everyone i need help in my query which is that: 1.which country name i selected from my dropdown list 2.when i select any country_name its show more info in new page.php like (this selected name show more information about country_name e.g. its captical, and cities through database in new page) and here is my code: <tr> <td>Country Name</td> <td> <select name="name"> <?php $conn = oci_connect("username", "pswrd", "db"); $sql = 'SELECT name FROM country'; $stid = oci_parse($conn, $sql); $success = oci_execute($stid); while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) { echo "<option value=\"countryname1\">" . $row['NAME'] . "</option>"; } ?>

Member Avatar
Member Avatar
+0 forum 4

I have a form and I need to connect the form with another page wich contains a table, afer pressing the submit button (form page), should redirect me the other page with the table,and there I shoul have a new row with the data I've completed. The pages are in HTML,can somebody help me?

Member Avatar
Member Avatar
+0 forum 1

Hello ! I have a task from my university that bothers me and I definately need some help. I have to create a web app in which i can add locations from the world map by taking the coordinates and make route between two selected locations from the added. Also the km/h between the two locations must be summed. Other important and maybe one of the main things is to calculate the total cost summed that you have to pay. If for example the traveler have 5 congestions and 3 of them are with bus and two are with train …

Member Avatar
Member Avatar
+0 forum 1

Dear all, I have a scenario, where I have a single table with all my users listed in them. Each user also has a field indicating the user they report to. UserID UserDisplayName UserReportsTo ----------- ------------------------------------------------------------ ------------- 8 Anthony Karimi 3 9 naheed kassam 8 1 Administrator 1 3 Ramakrishna 2 2 SB 2 (5 row(s) affected) In my scenario, i need when the user selected is say userid = 3, then the table displays userid = 3; userid = 8 who reports to userid = 3; and userid = 9 who reports to userid = 8 as shown below …

Member Avatar
Member Avatar
+0 forum 4

Whenever i execute this, only the last row of the loop gets inserted even if i click on the first row or any row. What i need is: if i click register, the entire selected row must store in another table Whats wrong here? Please help me.. <table class="table table-striped jambo_table table-bordered"> <thead> <tr> <th width="75px">Semester:</th> <th width="110px">Subject Code:</th> <th>Subject Name:</th> <th width="110px">Exam Type:</th> <th width="110px">Marks:</th> <th width="75px">Action:</th> </tr> </thead> <?php $view_users_query="select * from details WHERE regd_no='" .$_SESSION['regd_no']. "'";//select query for viewing users. $run=mysqli_query($dbcon,$view_users_query);//here run the sql query. while($row=mysqli_fetch_array($run))//while look to fetch the result and store in a array $row. …

Member Avatar
Member Avatar
+0 forum 1

I want to see the penalties updating, but it's only see after you click the return button and wait for one day again that it will show the penalty. <?php $user_query=mysqli_query($dbcon, "select * from borrow LEFT JOIN member ON borrow.member_id = member.member_id LEFT JOIN borrowdetails ON borrow.borrow_id = borrowdetails.borrow_id LEFT JOIN book on borrowdetails.book_id = book.book_id ORDER BY borrow.borrow_id DESC ")or die(mysqli_error()); while($row=mysqli_fetch_array($user_query)){ /* ---- This code below ---- */ $borrowdate = new Datetime($row['due_date']); $currentdate = new Datetime(); $returndate = new Datetime($row['date_return']); $fines = 0; if($currentdate > $returndate){ $days = $borrowdate->diff($returndate ?: $currentdate, true)->days; $fines = $days > 0 ? …

Member Avatar
Member Avatar
+0 forum 1

HI,everyone , I m stum in this question for long time, could somebody help me out, my output is success ,but the arrange in table is wrong. below is my code.. <?php $no_pensyarah=$_SESSION['no_pengguna']; $tahunsemasa =date('Y'); include '../includes/dbconnect.php'; $sql_rekod = "SELECT a.*,b.nama_subjek,c.nama_kursus FROM info_subjek_pensyarah as a, subjek as b,kursus as c WHERE a.kod_subjek = b.kod_subjek AND a.kod_kursus = c.kod_kursus AND tahun_bahagian LIKE '$tahunsemasa%' AND no_pensyarah = '$no_pensyarah'"; $result_rekod = mysql_query($sql_rekod) or die('Query failed. ' . mysql_error()); $tmpCount = 1; while($row = mysql_fetch_assoc($result_rekod)) {?> <?php $nama_kelas = $row['nama_kelas']; ?> <tr> <td><?php echo $tmpCount; ?></td> <td><?php echo $row['kod_kursus']; ?></td> <td><?php echo $row['nama_kursus']; ?></td> …

Member Avatar
Member Avatar
+0 forum 1

Hi, Im new to data table, im using DataTables 1.10.5 and i try to put center my pagination since it looks kinda messy on my table. Here is my code : Html: <table cellpadding="0" cellspacing="0" border="1" class="display example" id="example2" width="90%"> <thead align="center"> <th>a</th> <th>b </th> <th>c</th> <th>d</th> <th>e</th> <th>f</th> <th>g</th> <th>h</th> </thead> <tfoot></tfoot> <tbody align="center"> <?php $this->load->model('customer'); foreach ($queryByDate->result() as $row){ $a = $row->a; $b = $row->b; $c = $row->c; $d = $row->d; $e = $row->e; $f = $row->f; $g = $row->g; $h = $row->h; ?> <tr> <td><?php echo $a; ?></td> <td><?php echo $b;?></td> <td><?php echo $c;?></td> <td><?php echo $d;?></td> …

Member Avatar
Member Avatar
+0 forum 2

**USE SELECT...WHERE FOR TEXT FIELDS IMPOSSIBLE** I use SELECT search with WHERE fieldsname by VARCHAR imposible. But good use with INT fields. Why's that. Please tell me about it . My code as : <?php mysqli_select_db($connect ,'simple_login'); $sql = 'SELECT * FROM table where username= hai ' ; $retval = mysqli_query($connect,$sql); ..... ?> Not display error. But it's not connect and use with INT fields be good everything (as id=152)

Member Avatar
Member Avatar
+0 forum 3

Hello everyone! Basically a user is able to select one or multiple rows using checkboxes in a GridView and then a delete button which deletes selected rows. The problem is, the code behind for deleting works until I started using UpdatePanel. It just broke and I have no idea what went wrong. Here's my ASPX code; <asp:UpdatePanel ID="upl" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="serverclick" /> <asp:AsyncPostBackTrigger ControlID="GvGrade" /> <asp:PostBackTrigger ControlID="BtnRegister" /> </Triggers> <ContentTemplate> <asp:GridView ID="GvGrade" runat="server" AutoGenerateColumns="false" ClientIDMode="Static"> <Columns> <asp:TemplateField HeaderText="Task ID" HeaderStyle-HorizontalAlign="Center"> <HeaderStyle Width="100" BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <ItemStyle HorizontalAlign="Center" /> <ItemTemplate> <asp:Label ID="lblID" CssClass="lblID" runat="server" Text='<%# Eval("drug_id") %>'></asp:Label> </ItemTemplate> …

Member Avatar
Member Avatar
+0 forum 2

I have a table with nutrient data(in Dutch) it looks like this ![Nutrient_table.png](/attachments/small/1/ea03b9085fe045894414a3101f2d6b4b.png "align-left") My DB design skills are very low, I only know Mr. Codd is lurking 'round the corner somwhere. Could anyone give me some hints on how to set up my tables or should I just usr one table? Thanks in advance for any answer.

Member Avatar
Member Avatar
+0 forum 6

If a table contains field's like name,age tuition fee,bus fee,year, 1,2 When I tried to update 1 year details it is updating but when I try to update the entire fields it's not updating in form of jsp page

Member Avatar
Member Avatar
+0 forum 5

I am a beginner practicing how to create tables on SQL Here is what I've done: Create Table PO (Order_id int primary key, order_date date, customer varchar(1000)); Create table PO_Line_Item (Order_id int not null, Line_number int not null, Product varchar (30), Unit_Price decimal (10,2), Qty decimal (10,2), Tax decimal(10,2)); When I press execute it appeared "there is already an object named 'PO' in the database. What have I done wrong?? If any one have any ideas pls let me know

Member Avatar
Member Avatar
+0 forum 1

The End.