889 Posted Topics

Member Avatar for blackryu21

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 …

Member Avatar for darkagn
0
84
Member Avatar for keofua

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

Member Avatar for peter_budo
0
1K
Member Avatar for Asmodaii

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 …

Member Avatar for Asmodaii
0
106
Member Avatar for PinoyDev

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]

Member Avatar for PinoyDev
0
159
Member Avatar for rEhSi_123

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]

Member Avatar for nathenastle
0
108
Member Avatar for mrcniceguy

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.

Member Avatar for mrcniceguy
0
132
Member Avatar for Ken JS

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...

Member Avatar for SITI HARYANTI
0
400
Member Avatar for charlie81

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 …

Member Avatar for darkagn
0
90
Member Avatar for dragon@dragon64

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 + …

Member Avatar for dragon@dragon64
0
99
Member Avatar for peedi

[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 …

Member Avatar for peedi
0
157
Member Avatar for PhiberOptik

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...

Member Avatar for PhiberOptik
0
138
Member Avatar for Patrickkahuna

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.

Member Avatar for darkagn
0
77
Member Avatar for campuzcrazyness

Duplicate thread. [url]http://www.daniweb.com/forums/thread182148.html[/url]

Member Avatar for kebede
0
202
Member Avatar for ComputerGirl

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 …

Member Avatar for darkagn
0
137
Member Avatar for Lido98

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 …

Member Avatar for Lido98
0
1K
Member Avatar for csinquirer

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 …

Member Avatar for Narue
-1
81
Member Avatar for shahab.burki

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.

Member Avatar for darkagn
0
95
Member Avatar for justapimp

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 …

Member Avatar for darkagn
0
454
Member Avatar for darkagn

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 …

Member Avatar for nav33n
0
170
Member Avatar for praskuma

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 …

Member Avatar for praskuma
0
108
Member Avatar for slider_44

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".

Member Avatar for slider_44
0
96
Member Avatar for caps_lock

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 …

Member Avatar for caps_lock
0
152
Member Avatar for koolhoney07

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].

Member Avatar for verruckt24
0
2K
Member Avatar for niksni

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)?

Member Avatar for mwasif
0
88
Member Avatar for enitsirc

Hi enitsirc and welcome to DaniWeb, What are the "string comparison methods discussed" in your class? And the techniques for sorting arrays too...

Member Avatar for verruckt24
0
82
Member Avatar for rejoicegants

Check out [URL="http://devzone.zend.com/node/view/id/1712"]this article[/URL] on using Perl in PHP.

Member Avatar for darkagn
0
73
Member Avatar for Roybut

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 …

Member Avatar for darkagn
0
106
Member Avatar for nanna

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 …

Member Avatar for nanna
0
326
Member Avatar for Designer_101

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 …

Member Avatar for nav33n
0
620
Member Avatar for darkagn

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 …

Member Avatar for darkagn
0
173
Member Avatar for Lilal

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

Member Avatar for Lilal
0
103
Member Avatar for vimotaru

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] …

Member Avatar for debasisdas
0
136
Member Avatar for gabec94

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; } …

Member Avatar for gabec94
0
107
Member Avatar for freshfitz

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 …

Member Avatar for freshfitz
0
95
Member Avatar for shasha821110

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 …

Member Avatar for Monalisaparker
0
155
Member Avatar for achiman

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" ]; …

Member Avatar for almostbob
0
75
Member Avatar for MDGM

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 …

Member Avatar for nav33n
0
3K
Member Avatar for ProgrammersTalk

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...

Member Avatar for Ezzaral
0
602
Member Avatar for Dsiembab

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 …

Member Avatar for death_oclock
0
209
Member Avatar for zandiago
Member Avatar for veledrom

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 …

Member Avatar for veledrom
0
84
Member Avatar for Praveenhai
Member Avatar for AllenB

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 …

Member Avatar for sciwizeh
0
139
Member Avatar for marcosjp

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...

Member Avatar for diafol
0
156
Member Avatar for MDGM

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.

Member Avatar for MDGM
0
93
Member Avatar for Blondeamon
Member Avatar for darkagn
0
125
Member Avatar for ezkonekgal

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?

Member Avatar for ezkonekgal
0
156
Member Avatar for xlx16

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].

Member Avatar for stultuske
0
101
Member Avatar for rude04

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, …

Member Avatar for darkagn
0
218
Member Avatar for paucki

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 …

Member Avatar for stultuske
0
140

The End.