889 Posted Topics
Re: So you need to filter your SQL statement according to the dates entered. This is done like so: [code=php] $sql="SELECT * FROM visitors WHERE date_visited > '$startdate' AND date_visited < '$enddate'"; [/code] where date_visited is the date column in your visitors table and $startdate and $enddate are the dates that … | |
Re: Hi keofua and welcome to DaniWeb :) Can you post the error messages that you are getting please? That might help us to identify the problem. Regards, d | |
Re: Hi Asmodaii and welcome to DaniWeb, You haven't really told us what you are after, but I think you are a bit confused by this section of the code because of your description: [code=java] public void fun(int[][] grid){ int row, col; for (row = 0; row < NUM; row++){ for … | |
Re: I assume you want $nowdate to be a string. String concatenation in PHP uses a period character to join strings. This **should** work: [code=php] $nowdate = date('Y') . "-" . (date('Y') + 1); [/code] | |
Re: You don't need quote marks around table or column names. This SQL should work for you: [code=sql] SELECT * FROM forum_cats WHERE admin < ".$row['admin']."+1 ORDER BY admin ASC [/code] | |
Re: All that code does is tell the browser to use XHTML, it has nothing to do with the actual formatting of the page. More than likely you have a misplaced [icode]<b>[/icode] tag in your code somewhere. | |
Re: In binary, -1=1, so -P^t=P^t. What you have done looks good to me, but maybe someone else can check for you also? It's a long time since I did this sort of thing... | |
Re: private methods are called in exactly the same way as public methods with one difference - you can only call them from within the class that owns them. So , to call the sumString method from the main method for example, you can do the following: [code=java] public static void … | |
Re: This looks to be more of a PHP question than a MySQL question, but I think I can help. I would assign the results to variables in php and then simply add them. Like so: [code=php] $w = $row_standings['w']; $d = $row_standings['d']; $sum = $w + $d; echo "$w + … | |
Re: [code=java] if (inches = 10) { call setSize(); call setCost(); cost -=2; } [/code] This is where I believe your errors are. First of all, your if statement does not resolve, you need to use == to compare, like so [code=java] if(inches==10) [/code] Next, if you want to call a … | |
Re: Is your chat window in Java? If so is your GUI written in swing or awt? Perhaps some code to describe how you construct your window would help... | |
Re: I think in this situation you are better off explicitly joining the tables by account id. Like so: [code=sql] SELECT COUNT(J.account) from JanTable J INNER JOIN FebTable F ON J.account = F.account WHERE J.AmountPaid=0 AND F.AmountPaid=0 [/code] Otherwise you will get many duplicate records. | |
Re: Duplicate thread. [url]http://www.daniweb.com/forums/thread182148.html[/url] | |
Re: Hi ComputerGirl and welcome to DaniWeb :) You have two problems that I can see. The main problem is in your main method (excuse the pun). [code=java] public static void main(String[] args) { Student demo = new Student(); demo.setSize(250, 400); // ---!!! demo is of type Student which does not … | |
Re: Hi Lido98 and welcome to DaniWeb :) This can be done in SQL Management Studio in a few easy steps: [LIST] [*]First of all, you need to connect to Server B. [*]Once connected, you need to link Server A to Server B. In SQL Mngmt Studio 2005, this can be … | |
Re: The most basic program requires some form of planning, even if it is just a few notes on some scrap paper. It is always a good habit to plan, you will make fewer mistakes and write more manageable code if you spend time planning first. Personally I never "just jump … | |
Re: Your problem is in this line of code: [code=java] if(temp.getData().getData()==str) [/code] When comparing Strings you cannot use == to determine if they have the same contents. You must use the equals() method of the String class. | |
Re: The DATEADD function will do what you need. Its syntax is DATEADD(datepart,number,date) where the datepart parameter is the interval that you are adding (eg second which can be abbreviated to ss), the number parameter is the amount you are adding (eg 15 or -15) and the date parameter is the … | |
Hi all, I have noticed that there are some scrolling text advertisements appearing at the bottom of some forum posts, including mine. Now I understand that advertising probably goes a long way to generating the revenue that DaniWeb requires to remain operational. But I must say that I disapprove of … | |
Re: Hi praskuma and welcome to DaniWeb :) [code=sql] -- First, what info do you need? -- I have assumed just the title and description fields are what you want returned from this query SELECT Title, Description FROM Product -- Now we need to join to the Meta table to limit … | |
Re: So you will need to join the tables like so: [code=sql] SELECT resortloc, resortname FROM table1 INNER JOIN table2 ON table1.resortid = table2.resortid WHERE table1.resortloc = (SELECT MAX(resortloc) FROM table1) [/code] This is of course assuming that resortloc is a numeric value, ie 30 not "30 miles". | |
Re: Is this File object a directory? If so it must be empty to be deleted. The only other thing I can think of if this is not a directory is that maybe your issue has to do with file permissions? EDIT: And don't get impatient, we will help as soon … | |
Re: An integer in Java is a 32-bit number. If you need anything larger than that, I suggest you look at the Math.BigInteger class. Documentation for a BigInteger can be found [URL="http://java.sun.com/javase/6/docs/api/java/math/BigInteger.html"]here[/URL]. | |
Re: Ok, do you want to update the existing record (and if so, what is the ID of that record) or insert a new record with the combined data of the other two (what are their ID's)? | |
Re: Hi enitsirc and welcome to DaniWeb, What are the "string comparison methods discussed" in your class? And the techniques for sorting arrays too... | |
Re: Check out [URL="http://devzone.zend.com/node/view/id/1712"]this article[/URL] on using Perl in PHP. | |
Re: Hi Roybut, First of all let me say there are no stupid questions, only those too stupid to ask. :) Ok, now I have thought of a couple of things that could be happening here. First of all, are the two code snippets in separate php files? If so, have … | |
Re: Hi nanna, Sorry to weigh in on this conversation at such a late stage, but I think I see your problem. The compiler is pointing you to it with the error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at Ghu.personAdd(Ghu.java:142) It is saying that something is calling a method on line 142 … | |
Re: Hi Designer_101, This warning occurs when there is no connection to your mysql database setup properly. The actual call to mysql_query contains a second parameter which points to the mysql connection, and although this is an optional parameter, it causes problems if not included in the call explicitly if the … | |
Hi all, I am trying to make a simple game of Craps in Java. My idea was to have a JFrame with an image of the Craps betting table as the background image and when the player clicks on a section of the table they can place or remove a … | |
Re: Hi Steph, The Oracle forum can be found here: [url]http://www.daniweb.com/forums/forum129.html[/url] The people that frequent that forum might not necessarily come to the CS one, so might be worthwhile reposting your question there if you still need help. Regards, d | |
Re: Hi vimotaro, Are you asking if you receive a record you want to update an existing one with the data in that received record? If so, you can do this quite easily by running a [icode]SELECT COUNT(*)[/icode] statement and seeing if this returns 1. If it does, run your [icode]UPDATE[/icode] … | |
Re: I think those methods belong in the Box class itself. For example, [code=java] private class Box { private double length = 0.0; private double width = 0.0; private double height = 0.0; public Box(double boxlen, double boxwid, double boxhei) { length = boxlen; width = boxwid; height = boxhei; } … | |
Re: You can copy the data from one database to another, but the method depends on whether or not they are located on the same MSSQL Server instance. If they are, then you can qualify the database name like so: [code=sql] SELECT * FROM active.dbo.CustomerList A INNER JOIN temp.dbo.CustomerList T ON … | |
Re: You can pass variables to the [icode]$_GET[/icode] array in the action part of your form tag by changing the url to "bar.php?size=....". This will pass the parameter size to the $_GET array, accessed in your php code by [icode]$_GET["size"][/icode]. In a PHP url, anything after the .php? are variables for … | |
Re: Ok, so you will need three HTML [icode]<select>[/icode] tags and an [icode]<input type='submit'>[/icode] tag placed inside a [icode]<form>[/icode] tag in your HTML page. In your PHP, you can use the [icode]$_POST[/icode] array to retrieve posted data like so: [code=php] if( isset( $_POST[ "first_select" ])) { $first_selection = $_POST[ "first_select" ]; … | |
Re: Assuming the primary key is stored in a PHP variable, $key, then you can build your SQL query using double quotes: [code=php] $sql = "SELECT * FROM table1 WHERE ( SELECT COUNT(*) FROM table2 WHERE fbid = $key) > 150"; // run the query by passing $sql to your query … | |
Re: Australia, but not Sydney or Melbourne, which tends to be the only two places anyone outside of Australia knows. Adelaide is the capital city of South Australia, the dryest state of the dryest continent in the world. It's probably why I have such a dry sense of humour... | |
Re: A goto control structure? That is taking us back to the dim dark past... :P In all seriousness, if php was heading toward object oriented development, I can't think why a goto would be needed. Is it going to be like the old days, ie goto line 2376? I think … | |
| |
Re: No that shouldn't cause such a problem, just remember the rules when working with files: 1. Only give users access to files that you want them to have access to. Use permissions to restrict read/write/execute on files. I would suggest making sure that users can only read your location file … | |
Re: I'll send it to you for $45000. Let the bidding begin :P | |
Re: Yes, but you need to manipulate the string yourself. You will need to use a StringTokenizer to break the String up, and the Integer.parseInt method to work out the numbers (assuming floats and doubles are invalid). Have a go and see what you come up with, post back with your … | |
Re: You might want to invest in a third party WYSIWYG editor. There are lots out there, Google or another search engine might be a good place to start... ![]() | |
Re: I would use [code=sql] DECIMAL(10,3) [/code] This is a number with a total of 10 digits, up to 3 of which can be stored after the decimal. Adjust the 10 as needed, it is the default number used in the DECIMAL type in MySQL. | |
| |
Re: This sounds like sorting an array rather than a queue. As you said, queues work on the FIFO format, so you can't sort a queue since you will lose track of which one should be removed next. Are you sure this is what your task requires? | |
Re: Your question is not very specific. If you want to know how to create a String in Java, you do it like this: [code=java] String aString = "blah"; [/code] The String with name aString now contains the letters [B]blah[/B]. | |
Re: What are you trying to achieve by making your JFrame undecorated? If you wish to remove the user's ability to resize the window, you can use the setResizable() method to stop them from doing this (which you have done). If you want to stop the user from closing the window, … | |
Re: Hi paucki and welcome to DaniWeb, I am sure that all of us here at DW would be happy to try to help you with any problems that you encounter. That is the whole point of DaniWeb! Just post a description of your problem, as well as any relevant code … |
The End.