889 Posted Topics
Re: Days are simple, take a look at the date() function in the documentation at [url]www.php.net[/url] for more info. What do you mean by visibility? Of the days? | |
Re: Hi hmkk and welcome to DaniWeb :) [code=php] mysql_select_db($sumdueu_urworld, $sumdueu_admin); [/code] Your problem is most likely that the variable $sumdueu_admin has not been created correctly. This must be done with a call to mysql_connect() before the call to mysql_select_db() is made. This can occur in a previous script in your … | |
Re: Hi Mujahid158 and welcome to DaniWeb The mysql_query function returns a result set resource for select queries. You can't access it in the way that you are attempting, you need to specify the index of the resource. Like so: [code=php] echo $mem["username"]; [/code] For further information on the function, please … | |
Re: There are a few ways you can do this, but the simplest is probably to pass the variable via GET. To do this add the following line of code after you set $errorpas: [code=php] header("Location: User.php?errorpas=$errorpas"); [/code] Then at the top of your User.php script add the following lines: [code=php] … | |
Hi cscgal (and other site administrators), I recently received a PM from cscgal asking me to fill in an online survey. I was willing to do so, but just before I pressed the Submit button, I wondered if maybe her account had been hacked by a spammer. Does anyone know … | |
Re: Is there another variable with the name $results in your code or in an included file? Also I think you might want to use >= and <= rather than > and < in your comparisons. | |
Re: Not sure if this is your problem but have you restarted your webserver after installing the GD extension? | |
Re: I would have a single table, called user_pref, which would have the columns user_id, product_type_id, both of which would form the primary key for the table. If the user selects pets as a preferred option, add their user id and the pets category's id to the table. If the user … | |
Re: [QUOTE=rskelley;953800]Go to [url]http://www.php.net/docs/[/url] Start reading and start coding.[/QUOTE] I agree. Also there are tons of tutorials and code samples available on the web. Google is your friend. | |
Re: There are a few different types of SQL, but [url]http://www.w3schools.com/sql/default.asp[/url] is a good site for general SQL knowledge. [url]http://www.sql.org/sql-database/sql-tutorial/[/url] is a good beginner's tutorial but it is a little slow-paced for my liking - if you have programming experience you may feel the same. SQL is not too difficult when … | |
Re: If you mean a text box to type your title into, then you need to use an input tag of type text for a one-line box or a textarea tag for a multi-line textbox. If you are after a select box that you can type in, that will require some … | |
Re: Hi iamjmurphy and welcome to DaniWeb :) Can you please provide more information of your table structures and which fields you are trying to compare? It seems like it should be a fairly simple task, but I'm unsure exactly what you are trying to achieve. Cheers darkagn | |
Re: Hi watchinthegame and welcome to DaniWeb :) This is a bit odd. Can you please post your SQL query that you are using to update the record so we can take a look? Cheers d | |
Re: Hi Patrick, Unfortunately it is not as simple as that. Different languages are better at different tasks. Most are designed to perform specific tasks at first and grow from there. Really what you need to do is work out what you are trying to achieve and then select the best … | |
Re: Well, technically yes. A better solution would probably be: [code=php] if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') { // request comes from this server } [/code] but even this would probably not be too safe. What are you trying to achieve by knowing the request was from the server? | |
Re: [code=php] $desc->lastname = "Penner"; [/code] I believe your problem lies with this line of code. If you echo $desc to screen I think you will find that it relates to the lastname tag, not the user tag, so it is inserting a child of the lastname tag which is not … | |
Re: [code=php] $send="INSERT INTO mailbox SET member_id='$memid', user_name='$$_SESSION[user_name]', user_id='$_SESSION[user_id]', message='$message', inbox='NEW', subject='$subject', date='$dsub' " ; $save_result=mysql_query($save); [/code] What is $save? I think you are trying to run the query $send? | |
Re: Read up on arctan. It might give you a few ideas... | |
Re: The GridBagLayout is possibly what you will need. However, it is possibly the most advanced of Java's standard layouts. It gives you full control over margins (Insets) which gives great control over alignment issues. A google search should provide plenty of examples of the use of this layout. | |
Re: Basically the way that it works is everything after the ? is a set of key-value pairs. So, if you need to find $_REQUEST["msg"] you need the URL to read [url]http://xxxxx.php?msg=zzz[/url] Hope this helps, darkagn | |
Re: [code=php] if(51 < $bal && $bal < 75) [/code] This statement reads "if $bal is GREATER THAN 51 and LESS THAN 75". If you have $bal EQUAL to 51 it is not GREATER THAN 51. (Sorry for the shouting, but it is necessary to emphasise my point). What you need … | |
Re: Yes, with care. Always perform checks on session data to maintain security and integrity. For example: [code=php] $goal = $_SESSION["goal"]; if (strlen( $goal ) < 1) $goal = "Not set"; [/code] Just a simple example, but you get the idea... | |
Re: Change $_GET[user] to {$_GET['user']} (including the braces). An even better way would be: [code=php] $user = $_GET['user']; if(strlen($user) == 0) { echo "No user"; die; } $query = "INSERT INTO friendrequest (username,by) VALUES ('$user' , '$by')"; [/code] | |
Re: You are overwriting your $sql variable with the second statement. Try running the first SQL statement before you set the $sql variable, or you could change your second statement to use a new variable, for example $sql2. | |
Re: [QUOTE=mashimaro;908952] After years of coding all of a sudden I got a paper on "Authorization in instant messengers" to write. While creating a messenger and the authorization system isn't that big a deal, what can be written about it? It needs to be around 50 pages :/ [/QUOTE] So how … | |
Re: Hi alexstrong29 and welcome to DaniWeb :) If the recommended products are also in the products table, what I would do is add four columns to your product table that represent the product ID's of each recommended product for the row. That way your database grows by a lot less … | |
Re: There are two functions that you might find useful, [icode]in_array[/icode] and [icode]array_search[/icode]. Here is an example of their usage: [code=php] $employee = array(); $employee [] = array("name" =>"Chris Apple", "company" => "Acme inc.", "title" => "Developer", "salary" => "77000"); $employee [] = array("name" =>"Todd Orange", "company" => "Daves Dogs", "title" … | |
Re: You can get the current timestamp from the [URL="http://au2.php.net/manual/en/function.time.php"]time[/URL] function and parse it to a date through the use of the [URL="http://au2.php.net/manual/en/function.date.php"]date[/URL] function. If you do this when the user logs in or out and store it in your database, you can then retrieve this information quite easily. Have a … | |
Re: I believe that Object one is your observer and objects two three and four would notify it when their data changes. So Object one is your listener, the other objects are models in the explanation you gave above. | |
Hi all, I am fairly new to C# and WPF but I am super excited by the possibilities! I am currently experiencing an interesting problem with my project. Basically I have a MediaElement that displays a series of videos or images with transition effects between each of them. When I … | |
Re: When you say you suck at math, how bad is it? Are we taliking about not knowing advanced calculus and algebra, or not knowing your times tables? Who are you comparing yourself to? [URL="http://mathworld.wolfram.com/"]This site[/URL] has lots of tutorials, demonstrations and explanations that might help you. I have used it … | |
Re: You can use a combination of the [URL="http://au2.php.net/manual/en/function.substr.php"]substr[/URL] and [URL="http://au2.php.net/manual/en/function.strpos.php"]strpos[/URL] functions to achieve this. | |
Re: Hi mr_vodka and welcome to DaniWeb :) Love the username btw! :) If all you want from the budget table is the budget_name field, you could just try this: [code=mysql] SELECT fundinfo.fk_budget_ID, fundinfo.fk_tiertwo_ID, Sum(fundlink.fundlink_amt), budget.budget_name FROM fundinfo LEFT JOIN fundlink ON fundinfo.pk_fund_ID = fundlink.fk_fund_ID LEFT JOIN budget ON budget.pk_budget_ID = … | |
Re: readData is not a public variable, so you can't access it by myInput.readData. Try this for your Input class: [code=java] class Input{ private String readData; Input() throws Exception { readData = ""; File inputFile = new File("/home/alias120/Desktop/School/CMIS 141/Project 4/input.txt"); Scanner input = new Scanner(inputFile); while(input.hasNext()){ String s1 = input.next(); readData … | |
Re: Can you post your code for generating the ticket number and displaying it please? This might help us figure out where you are going wrong... | |
Re: The way you have to think about PKs is how are the records in this table unique? Your first option says that each source will have one record on a given day (is this true?). The second one says every record is unique which of course is true but doesn't … | |
Re: I believe that the Dude was banned some time last week for posting spam outside the Geeks Lounge which he had been warned about many times before. Not sure what happened to RF though... | |
Re: [code=html] <input type="hidden" value="$autoid"> [/code] The error is in this line, you have forgotten to name this field, so it can't find it in the [icode]$_POST[/icode] array. Try changing to this: [code=html] <input type="hidden" name="autoid" value="$autoid"> [/code] | |
Re: The function array_search retrieves the key for a supplied value in an array if found, or false otherwise. This means that you can use it to search any array that does not contain boolean values. So, to search your array I would do the following: [code=php] $arr = array(1 => … | |
Re: If you are using a MySQL database, you can easily limit the returned results in a query with the use of the LIMIT function. For example: [code=php] $sql = "SELECT * FROM messages WHERE userId = $userId LIMIT(0,30)"; [/code] displays the first thirty records. If I had LIMIT(30,60) that would … | |
Re: Hi martyulrich and welcome to DaniWeb, Do you know what is meant by theta notation? If you show us that you understand the top-level theory we might be inclined to help you with the specifics... | |
Re: Sorry what was your question? It seems to have been chopped because of the lack of spaces in it... | |
Re: Hi mveleli and welcome to DaniWeb :) That's exactly what we're here for. Please post any questions you have and include some of your coding attempts and we will try to help to the best of our ability. Happy programming! | |
Hi all, We are experiencing the following problem with the latest versions of IE and FF in regards to sessions. If anyone has encountered these problems before, any insight would be valuable. [B]In FF:[/B] An ongoing problem where sessions are saved across multiple tabs and windows in the same machine. … | |
Re: >> You can google on Math.ceil() and Math.floor(). Math.ceil(double x) rounds x up to the next largest integer-equivalent number. So Math.ceil(1.5) returns 2.0. Math.floor(double x) rounds x down to the next largest integer-equivalent number. So Math.floor(1.5) returns 1.0. These statements are a little misleading. Math.ceil() does not round the result, … | |
Re: Do you want to create a separate forum for each language? Or do you want to translate the same forum to different languages? I think the latter would be much much harder... | |
Re: One "drag and drop" PHP IDE that comes to mind is DreamWeaver from Adobe. I haven't used it much but from what I have seen I have liked, as it also allows you to create HTML, CSS, JavaScript and ASP files to name a few. I would also like to … | |
Re: Hi Somerston and welcome to DaniWeb :) You will need to join to the employee table twice to get the name for each column. Something like this should work: [code=sql] -- first select the columns required SELECT wo.id, em.name as submitted_by, emp.name as completed_by -- not sure if you can … |
The End.