Hi All, I have a sql query i am trying to get the count of how rows it returned. select a.field1, b.field2, c.field2 from table1 as a, table2 as b, table2 as c where a.field1=b.field1 Considered the above query return 9 rows. I want to get count of '9' in a mysql query. Please help. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 2

This is the report.php view [CODE] if(isset($_POST["addReport"])) { $report = new Report(); $report->employee_id = $_POST["employee_id"]; $report->date = $_POST["date"]; $report->job_id = $_POST["job_id"]; $report->description = $_POST["description"]; $report->attachment = file_get_contents($_FILES['attachment']['tmp_name']); for($i = 0; $i < count($_POST['date_range']); $i++) { $report->request_date[$i] = $_POST["request_date"]; } for($i = 0; $i < count($_POST['date_range']); $i++) { $report->quantity[$i] = $_POST["quantity"]; } for($i = 0; $i < count($_POST['date_range']); $i++) { $report->ms_num[$i] = $_POST["ms_num"]; } for($i = 0; $i < count($_POST['date_range']); $i++) { $report->info[$i] = $_POST["info"]; } for($i = 0; $i < count($_POST['date_range']); $i++) { $report->description[$i] = $_POST["description"]; } for($i = 0; $i < count($_POST['date_range']); $i++) { $report->date_recieved[$i] = $_POST["date_recieved"]; } $report->addReport(); …

Member Avatar
Member Avatar
+0 forum 3

Hello, I'm having a problem with my MySQL InnoDB table, only one of five. Every now and then a row or two will go missing completely with no trace of it being there in the first place. I have a website which takes HTTP requests from my desktop side client app and if their HWID isn't in the database, it adds it. The app connects every 1-5 minutes and works flawlessy (if I delete their row while it's running, it re-adds it. If I delete the row, then run the app, it re-adds it again). But for some reason, once …

Member Avatar
Member Avatar
+0 forum 4

I have a python script that reads a csv file and converts it to two new files so that my database can add new emails or update existing ones. What im trying to do now is after it has converted them for it to send me a email with how many rows it processed for both the add adn update file. I have the email part workign what has me stuck is the counting of the rows which for somereason everything i have tried returns me actual values from the files and not a number like im wanting to to. …

Member Avatar
Member Avatar
+0 forum 4

Hi, Hi I only want to select 5 rows. Can you please tell me how to do it in sql? Thank you. example: ratee rater apple banana apple orange apple peach apple sunkist apple mango apple grapes grapes orange I want to see random selected of 5 ratee orange with grapes also as ratee.

Member Avatar
Member Avatar
+0 forum 4

how to order rows in pl/sql? i have a table of numbers, i want to order in ascending order if id of table is odd and descending if id is even

Member Avatar
Member Avatar
+0 forum 5

I have this code which finds the duplicate rows .I want to check if the top row has weight greater than given minimum support..If true then generate its subsets. If row 1 i.e 11110011 wight>min_sup then generate subsets....if not then jump to next row here 1 represents presence of items and 0 represents absence... so row one has 1,2,3,4,9,12 so subsets i need is {1,2,3},{1,3,4},{1,4,9},{1,9,12} {1,2},{1,3}....etc Can anyone help */ package javaapplication42; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Smalldataset { public static void main(String[] args) { BufferedReader br = null; String[] line=new String[55]; int n, c, d, swap,i=0,j=0,min_suport,row=0,col=0,no_of_selected_item=0; …

Member Avatar
Member Avatar
+0 forum 2

I need to add Column1 + Column2 And Display Result In Column3 But I need to do it for all rows in column3 automatically. I need a very short code. Thankyou.

Member Avatar
Member Avatar
+0 forum 2

Ok, so I'm working on a web-project, I connected a custom hanlder to the root Logger in `contextInitialized()` of a ServletContextListener: @Override public void contextInitialized(ServletContextEvent sce) { Logger def = Logger.getLogger(""); Handler hand = new DatabaseLoggingHandler(); hand.setLevel(Level.WARNING); def.addHandler(hand); } which looks like: import java.io.PrintWriter; import java.io.StringWriter; import java.util.logging.LogRecord; import java.util.logging.Logger; import java.util.logging.Handler; import matrixpeckham.db.DBManager; public class DatabaseLoggingHandler extends Handler { private static final Logger LOG = Logger.getLogger(DatabaseLoggingHandler.class.getName()); @Override public void publish(LogRecord record) { String message = record.getMessage(); String logger = record.getLoggerName(); Throwable thr = record.getThrown(); String thrMess = ""; String thrStack = ""; if(thr!=null){ thrMess=thr.getMessage(); PrintWriter str = new PrintWriter(new …

Member Avatar
+0 forum 0

I need to get the name of the table with the biggest number of rows, I can find the biggest number of rows with function count and than function max, but i don't know how to see from which table is that maximum, can anyone help? tnx

Member Avatar
Member Avatar
+0 forum 3

I'm creating a table with PHP/MySql to enter local election results from my newspaper, I'm not a professional developer, more of just a hobbiest hack (who hasn't worked with PHP for a few years either), so feel free to correct existing code if you so please. What I want to do is to list vote totals for each precinct, and then have PHP total those totals. So, the way the data base would be set up is Race ID, Candidate Name, and each available precinct's totals. This is my current code to return one of the tables. What I would …

Member Avatar
Member Avatar
+0 forum 20

Hello Community, I was wondering if there is a way to limit users on how many database entries they can insert then once they have reached 100 (Max entried) entries it will delete old entries. So if the user has reached 100 entried and they try to insert another entry it will delete and old entry to make room for there entry.

Member Avatar
Member Avatar
+0 forum 7

Hello everyone :) I have this lines of codes and i get : > Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in D:\xampp22\htdocs\folder\index.php on line 52 ( 19 in the code below ) <form method="POST" action="index.php"> CODE : <input type="text" placeholder="Type the code" name="searchfor" /> <input type="submit" name="submit" value="Search for the code"> </form> <?php if(isset($_REQUEST['submit'])){ $searchfor = $_REQUEST['searchfor']; $terms = explode(",", $searchfor); // i've deleted this and no-positive results , i was thinking that it gives a false value to the code :-?? $query = "SELECT * FROM edit WHERE id=$searchfor" ; // i've tried also with …

Member Avatar
Member Avatar
+0 forum 7

Hi All, i have requirement like to Convert rows to columns in SQL server. i have retrieved data like below: MatchId SelectionName Odds 322 Home Win 1.33 322 Draw 5.00 322 Away Win 9.00 322 Under 2.5 2.40 322 Over 2.5 1.53 and want to convert like below: MatchId Home Win Draw Away Win Under 2.5 Over 2.5 322 1.33 5.00 9.00 2.40 1.53 how can i do this? Thanks, KK

Member Avatar
Member Avatar
+0 forum 2

I know there are other post conserning this but they dont seem to help me. When I run the varaible `$results` through the function `Mysql_num_rows()` it returns as an error saying its not a valid result. Also same for the `mysql_fetch_array()`. function results(){ if ($_POST['search'] != "") { $search = mysql_real_escape_string($_POST['search']); $search = filter_var($search, FILTER_SANITIZE_STRING); //remove unwanted characters from number. $search = ereg_replace("[^A-Za-z0-9]", "", $search); $search = strtolower($search); $search = preg_replace('/\s+/','',$search); } else{echo '<div class="noresults">No Results</div>'; die();} //start query for search $query = "SELECT * FROM members WHERE number = '$search' ORDER BY user_id ASC"; //run query $results = mysql_query($query); …

Member Avatar
Member Avatar
+0 forum 5

im trying to get the user to enter information into a textbox and then after clicking submit button the page has a table containing with that information in the rows. so for example the table has the heading Artist, Songs, Year made, Gene and the user has to enter data for each feild inside a text box and it store it in here. this is what i have so far <!DOCTYPE HTML> <HTML> <H2>JavaScript Sort Table</H2> <head> <script> function sortTable(col, myTable){ var cell = col + myTable.cols; var totalRows = myTable.rows.length; var tSort = 0; var columns = new Array(); …

Member Avatar
Member Avatar
+0 forum 2

hi :) is there a possible way where in we can combine two rows for an example i have this code: #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream outfile; outfile.open("1stRow.txt"); for(int i=1;i<10;i++) outfile<<i<<endl; outfile.close(); ofstream outfile2; outfile2.open("2ndRow.txt"); for(int j=2;j<11;j++) outfile2<<j<<endl; outfile2.close(); //return 0; } Like the output file would be 1,2 2,3 3,4 4,5 5,6 6,7 7,8 8,9 9,10 in another file :), its like you concatenate two strings... thank you in advance guys :)

Member Avatar
Member Avatar
+0 forum 6

Is there any way to get this to work in Internet Explorer? It shows/hides multiple rows in every other browser, but will only show one class's row in IE. Any help would be great. Here's the code. Thanks! <style type="text/css"> li.merk { list-style:none; display: block; width: 925px; padding:8px; margin-top:-20px; } .jamactive { width: auto; padding: 6px 11px; background: #0066CC; border: solid 1px #000099; font: 12px/100% Tahoma; font-weight: 500; letter-spacing:2px; color: #ffffff; -moz-border-radius: 5px; -webkit-border-radius: 5px; -webkit-appearance: none; cursor: pointer;} .jamactive:hover { background-color: #000099; border: solid 1px #000066;} .jaminactive { width: auto; padding: 6px 10px; background: #666666; border: solid 1px #000000; …

Member Avatar
Member Avatar
+0 forum 9

Trying to display events on my website based on what my clients want to view. I have 3 checkboxes setup to toggle the connected events, but I can't seem to make the onclick handle more than 1 event at a time. Basically, I want to know 1) how to display more than one tr row'd event with the selection of any given checkbox. 2) how to have all boxes checked on the page load (checked=true only checks the box with no info showing) 3) AND/OR how to create a CHECK ALL option 4) and, lastly, how to give it a …

Member Avatar
Member Avatar
+0 forum 3

I had a jquery-based code that messed up the slider on my page @ http://formidablehoops.blogspot.com Is there a way to have those two co-exist, or is there a way to toggle my calendar at the bottom with javascript instead? I've removed the code for now, but I think it's a bit much to view for potential customers. I would love it if I could have 5 different buttons running horizontally at the top, colored and named for the 5 different types of events I'd like to toggle. So someone could come to my site, see the calendar, press CAMPS, then …

Member Avatar
Member Avatar
+0 forum 3

i have a view named vw_admissionform with columns familycode,Regno,studentname,class for admission form . now if i want to print a student admission form by enetring registration no "regno" in txt1.text then his siblings should also be mentioned on the admission form as requirment by client. for this am using familycode a unique code for students of same family . i use select statment but how i can mention the siblings? "select familycode,regno,studentname,class from vw_admissionform where regno= '"& txt1.text & "'" Admission form format is Student Name :----------------- Class:------------------ Registration No:------------------ Sibilings Name------------------- Class:---------------------

Member Avatar
Member Avatar
+0 forum 4

Hi, i have been trying to combine data from 2 different sources, to make unique rows: here it is my situation Data in DGV already in dgv, Unbound: column1 | Qty "Sugar", 100 "Salt", 100 "Color", 200 "Malto", 150 Data in datatable: column1 | Qty "Sugar", 80 "Salt", 60 "Apio", 25 "Lemon", 60 "Color", 60 So i want a control that matches the column1 in datatable against DGV.Column1, and if value matches only add second column value and if not, then make a new row in DGV. Final decided outcome: column1 | Qty|Qty2 "Sugar"| 100 | 80 "Salt" | 100 …

Member Avatar
+0 forum 0

Hello there, I really need help ASAP. A user has two students(maybe more) where he need to complete marking the score sheet for the students. So, I have a score sheet where the user will insert their id in the textbox and then it will display the first studentName, studentID, studentTitle and studentProgram on the form. Then the user will insert mark for the first student, and click button "next" After clicking, the score sheet will display the second studentName, studentID, studentTitle and studentProgram on the form. I only able to do up to the first student. I dont know …

Member Avatar
Member Avatar
+0 forum 7

I have the show/hide table rows function working great now (thank you), but I am having a problem with using the back button. If someone has yes to one of the items (yes/no radio buttons) the onClick event in the input tag causes the appropriate info to display. BUT when I submit the form and then hit the back button (to make corrections) then the fields are hidden even though the yes button is clicked. I tried adding the following at the top of my code to initialize them based on the value of the radio button: function initShowHideRows(idName, clsName) …

Member Avatar
Member Avatar
+0 forum 6

Hi Guys, I have a form with a DGV and some text boxes.. I am trying to get the program to update the rows shown on the DGV by using the values in the text boxes. Below is my code so far: private void btnOrderEdit_Click(object sender, EventArgs e) { System.Data.OleDb.OleDbCommandBuilder cb; cb = new System.Data.OleDb.OleDbCommandBuilder(cashDA); System.Data.DataRow dRow2 = cashOrdersDS.Tables["cashOrders"].Rows[0]; dRow2[1] = Int64.Parse(txtOrderQTY.Text); dRow2[2] = txtBoxDescrip.Text.ToString(); dRow2[3] = txtBoxSupplier.Text.ToString(); dRow2[4] = dateTimePicker1.Value.ToString(); dRow2[5] = Convert.ToDouble(txtBoxCost.Text); dRow2[6] = Convert.ToDouble(txtBoxSell.Text); dRow2[7] = Int64.Parse(textBox1.Text); cashDA.Update(cashOrdersDS, "cashOrders"); MessageBox.Show("Data Updated"); } Any help would be great!

Member Avatar
Member Avatar
+0 forum 8

Hello everyone. I need some help with a SELECT FROM WHERE query. Let's say I have a row named A and another row named B, and I want to select the eventual cases where values from these two rows, somewhere, match eachother. In this case, you can see, that the only value that you can find in the both rows is '1'. (Check the table below). How can I make a SELECT statement out of this, where I want to sort out these occasions on when there are values of the same in the two rows? SELECT * FROM `table` …

Member Avatar
Member Avatar
+0 forum 4

Hello! This is my first post here, hehe. Seems to be a great site. Anyways, I'm quite new in PHP, but it's fun and I think I'm learning quite fast :) There's appeared a problem for me now though, and I can't see what the problem is...? I have made a form, which posts values to my php-page. This page inserts the values to the database, and that works just fine. But now I wanted to add the function to check if a value is already in use; in this case the value you entered in the email field. So …

Member Avatar
Member Avatar
+0 forum 2

I have been googling this and have read close variations of the following issue from others. It seems that if you are running MS office 2010 Excel and go to delete a group of rows, sometimes below where you are working a blank row will appear at maxamim height size and also several other rows will end up hidden. This doesn't happen every time but only every few times you perform a delete of some rows. You can restore the hidden rows by using the "unhide rows" tool and restore the huge row back to normal. This only seems to …

Member Avatar
+0 forum 0

Is it possible to reuse an identity field value after deleting rows in SQL Server 2005? Here is an example. Suppose I have a table with an Id field as a primary key (identity). If I add five rows, I will have these 5 Ids: 1, 2, 3, 4, 5. If I were to delete these rows, and then add five more, the new rows would have Ids: 6, 7, 8, 9, 10. Is it possible to let it start over at 1 again?

Member Avatar
Member Avatar
+0 forum 3

Question: Does anyone have any recommendations that are likely to keep a large database healthy/speedy? I'm designing a database that is going to retrieve around thirty million data points a year, up to around three hundred million to a billion in a few years time when all of the sensors come on line. The structure of the table containing all of the data is: +--------------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+----------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | feed_id | int(11) | NO | MUL …

Member Avatar
Member Avatar
+0 forum 1

The End.