889 Posted Topics
Re: I remember when I was really young on the Apple II playing games like Taipan (which was a pirates / smuggling game) and Chivalry (where you were a knight who wandered the land and competed in jousting tournaments and the like). It was also around this time that I was … | |
Re: Hi erlene and welcome to DaniWeb :) You have posted in the Game Development forum which is a forum for discussing game programming. I think you will have a better response from one of the tech forums on this site. I will say though that there are a number of … | |
Re: The line: [code=java] Criminal criminal = new Criminal(leftInput.name()); [/code] is trying to access the private variable leftInput which doesn't belong to your class. You only have access to the parameter e in this method. | |
Re: Try adding the following line to your script, anywhere after the line [icode]$dir = $documentroot . '/' . $username;[/icode] but not inside the function: [code=php] rmdir_r($dir); [/code] Basically, the code inside the function doesn't execute until the function is called. | |
Re: You need to do this in two separate SQL queries. First, use a select statement to retrieve the location ID given the posted area. Then use this result as the location number when inserting to the device table. | |
Re: Your error message is telling you what has gone wrong with this line: [code=java] if (hours == 16 && minutes == 23) [/code] Here you are trying to compare your variable hours which is a NumberDisplay object with the number 16, which is an int. That's like saying "If this … | |
Re: Hi intet, We only give help to those who show some effort. What have you tried so far? | |
Re: Hi easyb and welcome to DaniWeb :) You don't need to use Math.pow at all. Math.pow is used to find the power of a number. I wish that banks would pay interest exponentially but unfortunately... ;) I suggest you revise your notes on iteration and for-loops. I think what you … | |
Re: Hi Vikk and welcome to DaniWeb :) Have you made an attempt at this query yet? If you post what you have done we might be able to see what you are trying to accomplish and give some pointers. | |
Re: Hi gauravdott and welcome to DaniWeb, For number 1, I would use the mathematical proof by iteration - ie prove the statement true for n=2 then assume true for n=k and prove true for n=k+1. Number 2 is a little trickier but this link might help: http://en.wikipedia.org/wiki/Kruskal's_algorithm Kruskal's algorithm determines … | |
Re: Hi anshads, Just a word of warning - it is [B]very[/B] dangerous to post your personal phone number, address, passport number, credit card number or PIN number on a forum. You can send a private message to a forum-ite by clicking on their name and following the link marked "Send … | |
Re: I studied scheme at university for a semester and I don't remember much besides lots and lots of brackets. Most of the problems I had with it all boiled down to the fact that I had unbalanced brackets in my statements. Other than that it was relatively straight forward to … | |
Re: Hi raz0r and welcome to DanoWeb :) Not sure exactly what you are trying to do, but the rand function will give you a random number. You can read more about the rand function [URL="http://www.php.net/manual/en/function.rand.php"]here[/URL]. By microtime, do you mean time to the microsecond? If so, this can be achieved … | |
Re: Hi catcoffee and welcome to DaniWeb :) 1) Can be achieved with a [icode]<input type='file'>[/icode] in a PHP/HTML form. PHP then uses an array, $_POST, to retrieve all posted data and the $_FILE array to access uploaded files. 2) By validation do you mean making sure that the inputted data … | |
Re: This section is commented out: [code=php] <? $host="localhost"; // Host name $username="root"; // Mysql username $password="brijpuja1"; // Mysql password $db_name="newsumo"; // Database name $tbl_name="users"; // Table name $username=$_POST['username']; $oldpass=$_POST['oldpass']; $newpass=$_POST['newpass']; $conpass=$_POST['confirmpass']; $encry_oldpass=md5($oldpass); //encrypting old password echo "$encry_oldpass"; [/code] But I think you need it to connect to the database and … | |
Re: Try this: [code=php] $query2 = "SELECT tblclasslist.studentNo FROM acumenchain.tblclasslist JOIN acumenchain.tblregistration ON tblclasslist.studentNo = tblregistration.studentNo JOIN acumenchain.tbllogin ON tblclasslist.studentNo = tbllogin.studentNo AND tbllogin.studentNo = tblregistration.studentNo"; [/code] Does this give the desired result? | |
Re: Not sure what DaniWeb's policy is, but for other forum-type sites that I have contributed to we kept all PM's, emails, forum posts in database tables. If the owner of the message deleted it (by pressing a button for example) then we archived the message to another database table that … | |
Re: From the PHP Documentation: [QUOTE] Note: Whenever you specify "localhost" or "localhost:port" as server, the MySQL client library will override this and try to connect to a local socket (named pipe on Windows). If you want to use TCP/IP, use "127.0.0.1" instead of "localhost". If the MySQL client library tries … | |
Re: [code=java] String number = Float.toString(number); [/code] I think what you are trying to do is convert the number n to a string yes? What I would do is this: [code=java] String number = new Float(n).toString(); [/code] Here I create a Float object from my float primitive, then convert it to … | |
Re: Hi ankiwalia and welcome to Daniweb :) Your SQL syntax is incorrect. Instead of this: [code=java] String query="select username and password from Registeredusers"; [/code] Try this: [code=java] String query="select username, password from Registeredusers"; [/code] | |
Re: Your line: [code=java] while (i<=k) [/code] is placed before k is properly initialised. I think you need a line inserted to receive the input that you are prompting for. That is similar to your line that reads: [code=java] x=input.nextDouble(); [/code] but for k instead of x (I'll let you figure … | |
Re: Somewhere in your code you are passing a null value when you can't. If I had to guess I would say your problem occurs somewhere near these lines of code: [code=java] URL url = this.getClass().getResource("logo.jpg"); Image img = Toolkit.getDefaultToolkit().getImage(url); [/code] | |
Re: 1/2 is 0 remainder 1 because you have 0 whole divisions into 2. You are correct in saying that it is 0.5, but when doing a conversion between bases we deal only in whole numbers. | |
Re: Hi lcyew and welcome to DaniWeb :) Do you mean that you want to provide an export facility, or that you need to export your source code to those formats? To provide an export facility you need to: - read the contents of the file to be exported using file_get_contents … | |
Re: Back when I worked for the Australian Defence Department I was writing code that simulated warships communicating with each other. During testing I had 4 pc's talking to each other via UDP and TCP communication. The hardest part about it all was remembering which ship was being simulated by which … | |
Re: Hi surf and welcome to DaniWeb :) [code=php] echo '<option value=\"$key\">$value </option>\n'; [/code] This line is your problem. Swap all ' with " and vice versa. The problem is that $value is not evaluated inside single quotes. Your code should look like this: [code=php] echo "<option value='$key'>$value </option>\n"; [/code] Note … | |
Re: Try this: [code=php] <?php // php code here ?> <!-- HTML code here --> <input type='button' name='myButton' id='myButton' onClick="window.open('viewhotel.php?id='<?php echo $row['id']; ?>','mywindow','width=400,height=200')'" /> [/code] Is that what you meant? | |
Re: $results is a resource that can be used to grab an array using any of the mysql_fetch functions: [code=php] while(($nextRow = mysql_fetch_assoc($results)) !== false) { $column1 = $nextRow["column1"]; // etc } [/code] The loop will stop when there are no more records to be fetched. | |
Re: Certainly it is important to liase with the end user in any project. If you are managing a database for accountants, then yes you will need to understand what they will use the database for and what information they expect to be able to recall. For your second question, might … | |
Re: Hi Davros and welcome to DaniWeb :) So are you trying to change the code that embeds the editor on the fly? If so, according to what criteria? I'm a little confused as to what you want to achieve. | |
Re: Hi duckman_ca, I'm fairly new to C# so I don't know xml.InnerText, but XML parsing in PHP is quite simple thanks to several libraries we have available. Take a look at SimpleXML or the standard DOM library as a start, but there are others. For a full list and documentation, … | |
Re: Personally I find it difficult to critique UML when I am not sure exactly what you are trying to achieve, but I'll give it a go. It looks good except for a couple of things that I noticed. First of all, you have a User having a Family, I think … | |
Re: Can you post the code for your [icode]Record[/icode] class? I suspect the answer might be that you need to override the Equals method, so if you haven't done that I would start there... | |
Re: The code that ivatanako has given you is probably as simple as you can get. It will allow you to connect to your database and run a query. You can extend it if you need, but I can't see how it could be simplified further as you need those steps … | |
Re: Using double quotes in PHP has many advantages, not the least of which is that all variables will be evaluated inside them. Consider the following code: [code=php] for($i=0; $i<10; $i++) echo "$i "; [/code] This will output: 0 1 2 3 4 5 6 7 8 9 The following code: … | |
Re: [QUOTE=click here;985787]hi iam tried to send mail but see how it appear iam use mail function when i make 2 line the message appear line one [COLOR="Red"]\n[/COLOR] line 2[/QUOTE] You need to set a new line as <br /> in an HTML email or \r\n in a plain text email. … | |
Re: Also, make sure that you never send unencrypted passwords via GET as they will be visible in the URL. There are also hacking tools which allow the retrieval of POST data, so watch out for that too. | |
Re: This post is just to see the function with formatting, I will try to help you shortly. [code=php] function text_limit($str,$limit=10) { if(stripos($str," ")) { $ex_str=explode(" ",$str); if(count($ex_str)>$limit) { for($i=0;$i<$limit;$i++) { $str_s.=$ex_str[$i]." "; } return $str_s; } else { return $str; } } } [/code] | |
Re: You have three entries in your $_POST array that are themselves arrays. The addslashes function expects a string and can't parse the array. Try this to see what is going on: [code=php] if (isset($_POST)) { echo "<pre>"; print_r($_POST); echo "</pre>"; [/code] This will print out your $_POST array in a … | |
Re: You need to iterate through each of the table rows like so: [code=php] $sql = "SELECT * FROM ddcart_products"; $result = mysql_query($sql); $totalweight = 0; while($data = mysql_fetch_assoc($result)) { echo '<br />'; echo $data['name']; echo '<br />'; echo 'Weight: '.$data['weight']; echo '<br />'; echo 'Qty: '.$value; echo '<br />'; $weight … | |
Re: You don't need to "put" your stored procedure somewhere, you create one by executing a [icode]CREATE PROCEDURE[/icode] statement. As cwarn23 mentioned, you will need a database with tables etc for your procedure to be able to do anything. | |
Re: [QUOTE=firstPerson;982988]They are not rigged. Do research before you answer some question that you are not 100% sure.[/QUOTE] In Australia the law states that gaming machines must have a return to player ratio of at least 86%. That is, over the long term, every $1 spent wins 86 cents (or loses … | |
Re: In addition to what Ez has said, I would change your forever loop (that is your [icode]for(;;)[/icode] ) to [icode]while(cash > 0)[/icode], that way when the player runs out of cash the game is over. | |
Re: >If you specify an invalid language, it defaults to using the one from the >current forum. csharp is now invalid in favor of C#. For c++, you can do >C++ or cpp. code=php is not working in the PHP forum. EDIT: Just went back to get a screenshot to post, … | |
Re: Hi andym67 and welcome to DaniWeb :) A better approach is this: [code=php] if(isset($_SESSION["namevalue"])) $val = $_SESSION["namevalue"]; else $val = ""; // maybe do some validation on $val here echo "<input name='fname' type='text' class='textfield' id='fname' value='$val' />"; [/code] or: [code=php] <?php if(isset($_SESSION["namevalue"])) $val = $_SESSION["namevalue"]; else $val = ""; // … | |
Re: Hi gouthamvel and welcome to DaniWeb :) I think we may need a bit more information to help you on this one. Can you please post the code for the select tag that this option tag is a part of? What do you mean by the script won't work? Does … | |
Re: Are you sure that your $_SESSION['SESS_ORDERNUM'] is set correctly? Try echo'ing your sql statement before you send it to mysql_query and see... | |
Re: So is $title the title of a single RSS feed item? If so, you can do something like: [code=php] $count = 0; foreach($rssFeedItems as $title) { if(empty($title)) echo ++$count; // a prepend increment will add one to $count before it is used else echo $title; } [/code] | |
Re: I must admit that javascript is not my strong suit, but I will try to help. The line [code=html] tbl2 = tbl2 + GenerateRow() [/code] What happens in javascript if you call a function without the parameter in the method signature? Also you appear to be missing several ;'s to … | |
Re: The key to solving this problem is how the form is submitted when the user selects from the first drop down. When the form is submitted, their selection is placed in the superglobal array [icode]$_POST[/icode] with the array key equal to the name parameter of your select tag. Your form … |
The End.