Search Posts

MySql Database and Website Stops Working

i am Using RHEL Server With Two 3.0 XEON CPU and Two 8 GB RAM Cloud Server, I have an Database of 10 GB and have Primary table with 1 Million Records Added Every Month, This Website is earlier in .Net and MS SQL , When Shifted to PHP/MySql it got hanged in 10 minute of launch and when we restart the server it again got hanged we have 60000 Registers Users. who used this […]

How to Populate a Drop down box from a mySQL table in angular4

In PHP, HTML i just simply used to fetch data in array and show it in the selectbox as shown below – <?php mysql_connect(‘hostname’, ‘username’, ‘password’); mysql_select_db(‘database-name’); $sql = “SELECT nameid FROM PC”; $result = mysql_query($sql); echo “<select name=’PcID’>”; while ($row = mysql_fetch_array($result)) { echo “<option value='” . $row[‘nameid’] . “‘>” . $row[‘nameid’] . “</option>”; } echo “</select>”; ?> I mean i can connects to a MySQL database, issue query, and outputs tags for a […]

How to select 100 ordered rows where (column_value = X) to where (column_value = Y)?

I have a MySQL table with rows that are always changing. Assuming that it is ordered by the registered user ID, some rows are deleted or inserted between others. I want to loop through all of the rows in a limit of 100 per script execution. something like: SELECT column_name FROM Table_name WHERE ID>X AND ID and limited to 100 and ordered by ID column. I can’t use Auto increment row id Source: Stackoverflow

how to change vat % to 0

I have downloaded an open source project of stock management system. But its default vat % is 13% but I want to be 0% or can I entirely delete this section? By the way this is the codes for vat % var vat = (Number($(“#subTotal”).val())/100) * 13; vat = vat.toFixed(2); $(“#vat”).val(vat); $(“#vatValue”).val(vat); Source: Stackoverflow

SQL: department name with minimum of 10 employees

I have a table for employees and another for department names. The constructions are employees – employee_id – employee_name – department_id departments – department_id – department_name I want to show a table with department names where more than 10 employees work. The query I tried without results is: select count(*) as count,d.department_name from employees e inner join departments d on e.department_id = d.department_id where count(*) > 5 group by d.department_name please suggest correction Source: Stackoverflow

SQL query assistance nested and count query

I have 4 rows in a table: Players PlayerName (8 distinct players) Performance good bad Salary (integer) PositionPlayed (5 distinct positions) I am looking to get an output where it shows the names of players and the count of number of times the player played in a particular position when performance is bad. James | Kobe | Jordan Center 5 | 8 | 5 PF 3 | 5 | 2 PG 2 | 1 | […]

how to add column dynamically using hibernate

I’m practicing ‘Hibernate’ with mysql. I want to add new column like ‘ALTER TABLE Student ADD COLUMN phone varchar(255)’ by using hibernate. But, I don’t know how to code function ‘addColumn()’. package hib.dia.gol; public class Student { private long id; private String name; private String degree; public Student() { = null; = null; } public Student( String name, String degree ) { = name; = degree; } public long getId() […]

Sql request isn’t working

The problem is that request in action.php isn’t working, but it also don’t returns any errors. Folder/user.php: …. <div class=”col-md-6″> <div class=”form-group label-floating”> <form class=”form-inline” action=”../folder/action.php” method=”post”> <input type=”number” class=”form-control input-sm” name=”days” placeholder=”Days” style=”width: 70px;” required> <input type=”text” class=”form-control input-sm” name=”reason” placeholder=”Reason” required> <input type=”hidden” name=”userid” value=”‘.$id.'”> <input type=”submit” class=”btn btn-simple btn-round btn-xs” name=”action” value=”Do action”> </form> </div> </div> …. Folder/action.php: <?php include_once $_SERVER[‘DOCUMENT_ROOT’].’/configuration/main.php’; // taking main info with connection info if ($_SESSION[‘admin’]<3) exit(redirect(“../folder/”,2)); // […]

Excluding a column in a foreach table without losing the data

I need to stop the ID column from displaying in a foreach table generated in html/php but at the same time I still need to refer to the data to edit by ID. Here is the code. $queryz = “SELECT * FROM box WHERE date=CURDATE()”; print “<table> “; $result = mysqli_query($db,$queryz); //return only the first row (we only need field names) $row = $result->fetch_assoc(); print ” <tr> “; foreach ($row as $field => $value){ print […]

Next Page » « Previous Page