889 Posted Topics
Re: The DATEPART function might come in handy here. Not sure exactly how you could do it without writing a procedure, but take a look at the MSSQL documentation for the DATEPART function and see if you get any inspiration from it. | |
Re: Have you tried a HAVING clause instead of a WHERE clause? I don't really understand the difference, but sometimes HAVING works when a WHERE doesn't. Your query would become: [code] SELECT TS.col1, TS.col2, count(*) AS Number FROM view_scary VS LEFT OUTER JOIN table_scary TS ON VS.IdContact = TS.IdContact GROUP BY … | |
Re: Hi dirbacke and welcome to DaniWeb :) Please read the forum rules at the top of this forum. Also, please take note of the date of forum threads, particularly if they have been marked as solved, before posting. However it is always nice to see a new face here at … | |
Re: [quote]the php file is my problem it is supposed to delete product and add a replacement for it [/quote] What is it doing instead? Do you get any errors? | |
Re: What do you mean by "Game Developer Software"? IDE, Modelling Software, Game Engine, Compiler, or something else perhaps? It will most likely be a matter of opinion anyway, can you narrow down your criteria of what you are trying to achieve? EDIT: Oh, are you also CMSHelper? Perhaps this is … | |
Re: It's a bit hard to tell from the code you have posted. Do you have code for the classes in question that you can post? | |
Re: There are no errors displayed because you are catching the exceptions and not doing anything with them. Try this to see what is happening: [code=java] } catch (MalformedURLException me) { System.err.println(me.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } [/code] | |
Re: You can't use the == operator on a string comparison in java. You need to call the equals method like so: [code=java] if(input.equals("sixty")) [/code] | |
Re: Hi Shubhang and welcome to DaniWeb :) I am sorry, but I don't understand what you are asking. Can you please post some code to show us what you mean? | |
Re: Simple example: [code=java] static int MAX_TESTS = 5; int test = 0; boolean result = true; int something = 6; while(test < MAX_TESTS && result) { result = (something > 7); test++; } [/code] EDIT: Basically, the while loop takes a boolean condition. This can be the result of a … | |
Re: Hi snarb and welcome to DaniWeb :) Your criteria are a little vague. -Send cursor to set coordinates and click -> not sure what you mean here. -Copy and store information -> if you mean permanently, then you need a language which can either write to a file or to … | |
Re: I would suggest reading up on the following functions in the PHP documentation as they will come in handy when dealing with dates: [URL="http://www.php.net/manual/en/function.date.php"]date[/URL] [URL="http://www.php.net/manual/en/function.strtotime.php"]strtotime[/URL] [URL="http://www.php.net/manual/en/function.strftime.php"]strftime[/URL] For example, to find the current year, use the following code: [code=php] $now = strtotime("NOW"); // timestamp of current date/time $currentYear = date("Y", $now); … | |
Re: I'm no expert on bat files, but I would suggest changing the line that reads: [icode]java -Xmx500M -cp .;./classes/; server[/icode] to: [icode]java -Xmx500M -cp .;./classes/src/; server[/icode] and see if that fixes your problem. | |
Re: Actually I can see the benefits of the [I]initial[/I] proposal which mostly targets child pornography and terrorism sites. However I am a bit of a cynic. Once in place who's job will it be to say what is offensive and what is acceptable. I mean, we can't even get an … | |
Re: When deleteing from multiple tables, you need to specify what is being deleted. There are two available syntaxes: [code=mysql] DELETE table1, table2 FROM table1 INNER JOIN table2 ON table1.id = table2.id WHERE table1.id = 1 [/code] or: [code=mysql] DELETE FROM table1, table2 USING table1 INNER JOIN table2 WHERE table1.id=table2.id AND … | |
Is it possible to flag a Personal Message as Spam? I received two identical messages from a banned member today but couldn't find a way to report it. | |
Re: Why not just do: [code=php] if(strlen($str) > 25) [/code] | |
Re: All dates in MySQL are in the format: yyyy-mm-dd. Notice the hyphens and the number of digits ie 4 for the year, 2 for the month and 2 for the day. Today's date would be entered as 2009-12-24 and New Years Day would be entered as 2010-01-01. That said, if … ![]() | |
Re: This line: [code=php] $result = mysql_query("select * from presenters;"); [/code] should be: [code=php] $result = mysql_query("select * from presenters"); [/code] | |
Re: Where is $fullurl set? Also, $b[jobid] should be $b["jobid"] or $b[$jobid] depending on what you meant. | |
Re: You can use single quotes to do this. Take a look at the difference between these lines of code and you will see: [code=php] $foo = "Something witty..."; $blah = "Something strange..."; $string = "$blah"; // $string now equals the string {Something strange...} $string = '$foo'; // $string now equals … | |
Re: You need to specify the relative path from the script calling the constructor, not from the class. For example, if your class and xml file are in the /classes folder, then you need to call $mysql = new sqlConnection("classes/path.xml"); I know that may seem strange considering that the class is … | |
Re: You could try: [code=php] if(isset($_POST["restroomsyn"])) $restroomsyn = ($_POST["restroomsyn"]); else $restroomsyn = null; [/code] Then when you are inserting use is_null to check for null and set the column to NULL in this situation. | |
Re: Not sure of the maximum size, but you may want to think about the effect of having a 1MB script on your bandwidth and website performance during peak periods. | |
Re: Hi shariqmsit and welcome to DaniWeb :) "hospital administration database" is pretty abstract. I think you need to define what is required a bit more than that before you even think about database design. | |
Re: The main method in a java application has the following signature: [code=java] public static void main(String[] args) [/code] If you are a beginner I would suggest starting with something a bit simpler than a JButton's click method. But the theory behind it is to add an ActionListener to your button. … | |
Re: Without the parameter, the printer_open function attempts to find the default printer from your php.ini settings. If it can't find them it will then use the default printer of the machine running the script. It is always recommended to specify the printer name if known, or prompt the user for … | |
Hi all, I have seen code of the form: [code=php] if(file_exists("foo.php") include("foo.php"); else include("blah.php"); [/code] As far as I know, this is perfectly legal in php. What I was wondering was is it possible to do the following in in-line code in PHP? [code=php] if(file_exists("foo.php") // contains a specialised version … | |
Re: Hi alreem, We can only help you if you show that you have made some sort of an attempt. Do you have an algorithm or some code that you have tried? We may be able to point you in the right direction if we can see what you are thinking... | |
Re: Instead of: [QUOTE][code=java]System.out.println("join method test = " + join('a', 'b', 'c'));[/code][/QUOTE] you want to call join like so: [code=java] // build a char array containing the three characters you tried char[] chars = new char[3]; chars[0] = 'a'; chars[1] = 'b'; chars[2] = 'c'; // pass the array into the … | |
Re: I don't believe that you need a profile_id, just use the user_id as the key in the profiles table. When you create a new user, insert a record into both tables. When you delete a user's account, delete from both tables. To access the profile of a user, you can … | |
Re: Use the SUBSTRING function. [code=mssql] SELECT SUBSTRING(ImageLink, 2, 100) FROM TheTable -- the 2 indicates start at index of 2, the 100 will give you the next 100 characters in the string "ImageLink" [/code] | |
Re: You type [icode]java Hi[/icode], there is no need to specify the ".class" to run your program. Also, you will need a main method in that class to run the program. | |
Re: In order to run a method that takes an array of integers and returns their sum, your method will need the following signature: [code=java] public static int sumArray(int[] anArray) [/code] Then, instead of having the line [icode]sum = sum + anArray;[/icode] in your main method, after your loop you can … | |
Re: You can't use a switch statement like the way you are attempting. Try changing those switch statements to if-else statements and you should be fine. | |
Re: You can simply pass the Count to the Max function like so: [code=mySQL] select max(count(ProgramType)) as MAXCOUNT from credential_state group by ProgramType [/code] | |
Re: Not sure if this is your problem, but I think you may need a <body> tag between your <html> and <table> tags. | |
Re: [QUOTE=benkyma;1044108]I need to make ten selections. One of all the datetimes in the last 24 hours, the next one from 24 hours to 48 hours, and on back in 24 hour blocks for the last ten days. I've tried various approaches to this, but this is what I currently have: … | |
Re: There are lots of free site map generator tools out there. One of the most popular ones is Google's phpSitemapNG. [URL="http://enarion.net/google/phpsitemapng/"]Here[/URL] is a link to the home website for this tool. | |
Re: The line: [code=php] new Cite; [/code] means that there needs to be a class called Cite, not a file called Cite.php. Even if there was a Cite class, the code in the wfCite function wouldn't need that line as it doesn't reference the object after that. Remove that line and … | |
Re: The call to mysql_query returns true if it is successful, false if it is not. You can therefore call it inside the condition of an if-statement. I believe you can do that in C++ too if the function call returns a boolean result. In PHP you don't HAVE to use … | |
Re: Lots of noobs have trouble connecting to a MySQL database and running queries, displaying results etc. Another good tutorial might describe the differences between the popular browsers such as IE, FF, Safari, Chrome etc. All good web developers need to know what to expect, but too many only focus on … | |
Re: Sorry hedwards09, we can only give homework help to those that make an attempt first. Can you post what you have so far with the specific problems you are having? If you haven't started coding yet, what ideas do you have so far? We may be able to guide you … | |
Re: Hi bhoop and welcome to DaniWeb :) There are tools out there that allow you to create an exe from a java application. However this defeats one of the main advantages of java, portability. You would need a pretty good reason to go down that path, I believe... | |
Re: Hi Ballen92 and welcome to DaniWeb :) What's the error message you get? If I had to guess on the information you've given us, I would say that the method addKeyListener is not defined for your class. What class does Robot extend? | |
Re: I think if you remove the line [code] traverseInOrder.successor.predecessor = newNode [/code] your algorithm will be correct. Remember, node.successor.predecessor should always equal node unless node is the last node in the list. Same with node.predecessor.successor, unless node is the first in the list. | |
Re: I believe it is possible to set a flag to generate javadoc for private/protected fields and methods. I think its [icode]-private[/icode] or something like that. Google might be able to help you some more on that. | |
Re: Has your session started correctly before the call to your function? Check by echo'ing $_SESSION["Last_Page"] and make sure it's what you expect. What error message do you generate? |
The End.