- Strength to Increase Rep
- +15
- Strength to Decrease Rep
- -3
- Upvotes Received
- 207
- Posts with Upvotes
- 179
- Upvoting Members
- 96
- Downvotes Received
- 54
- Posts with Downvotes
- 53
- Downvoting Members
- 8
I am high on life !
- Interests
- Computers, music, playing with hitler(my "german" shepherd dog), cooking, long drives,…
- PC Specs
- I have a crappy computer.
1,741 Posted Topics
Re: hmm.. AFAIK, only mysql uses port 3306. To check what ports are being used, open command prompt and type netstat -ab. It ll list all the applications and the ports used by those applications. Maybe that port is blocked by your firewall ? | |
Re: @vipin_php, Next time, please put your code in [code=php ] [/code ] tags. | |
Re: [code=php] <?php $arr=array(); for($i=0;$i<7;$i++){ $arr[$i]="./img/images/".$i.".jpg"; //assigning the image location to the array $arr. } $random=rand(0,6); //generating a random number echo "<img src=".$arr[$random].">"; //printing the image ?> [/code] Thats it :) | |
Re: When the user logs in, check if its a valid login. If, yes, then query the table which has the user details for this username. Since this is a login script, username has to be unique. So, a username can have only 1 row of details. [code=php] <?php //connection //get … | |
Re: [code=php] <?php $filename ="excelreport.xls"; $contents = "testdata1 \t testdata2 \t testdata3 \t \n"; header('Content-type: application/ms-excel'); header('Content-Disposition: attachment; filename='.$filename); echo $contents; ?> [/code] This is the simplest way to generate an excel report. ![]() | |
Re: This simply wouldn't work because this is how your source would look like. [code] <input type= "text" name ="ch1" disabled='true' disabled='false'/> [/code] ![]() | |
Re: [code=php] <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="forum"; // Database name $tbl_name="test_mysql"; // Table name // Connect to server and select databse. mysql_connect($host, $username, $password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); $sql="SELECT * FROM test_mysql"; $result=mysql_query($sql); $count=mysql_num_rows($result); ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> … | |
Re: The problem is, [quote]if((!empty($_FILES["car_info_file"])) && ($_FILES['car_info_file']['error'] == [/quote] and all will not be accessible inside the function. Instead, pass $_FILES as parameter for the function. [code=php] upload_files($_FILES); [/code] Then you can access it in your function like, $fil['car_info_file']['name'] and so on.. Btw, type is application/xls.. | |
Re: [quote] Please Bang dani Help me asap, i'll say thank' you and thanks Salam Open Source, please cc to my email <EMAIL SNIPPED> thx [/quote] :-O What the .... | |
Re: Yep. If its a csv file, then you can make use of [url=http://nl3.php.net/manual/en/function.fgetcsv.php] fgetcsv [/url] to do the required operation. | |
Re: [quote](Incidentally, if you get the time, what exactly is the recommended code doing?) [/quote] [icode] ob_start() [/icode]. Its turning on the output buffer. So any output is kept in the buffer. And [icode]ob_flush() [/icode] is to flush the buffer :) | |
Re: If you want to count the number of records in the table, you can use mysql_num_rows. [code=php] $query = "select * from tablename"; $result = mysql_query($query); echo mysql_num_rows($result)." records found..."; [/code] If you want the number of columns in a particular table, [code=php] $query = "show columns from tablename"; $result … | |
Re: [code=php] <?php $file="test.xls"; $test="<table border=1><tr><td>Cell 1</td><td>Cell 2</td></tr></table>"; header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=$file"); echo $test; ?> [/code] This works. | |
Re: [url]http://davidwalsh.name/backup-mysql-database-php[/url] A good script to backup the whole database or just a few selected tables. Note: While generating the backup file, he uses the command drop tablename. You better ignore (comment) that line :) Edit: I somehow missed 'excel' in your post. This takes the backup on a .txt file … | |
Re: If you want current date and time to insert to a table, you can use now() function of mysql. [url]http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_now[/url] | |
Re: [QUOTE=duttydea;626807] How can i add the data from the array to a Mysql table?[/QUOTE] If you have a multidimensional array (or even a normal array), you should go through each and every element of the array (iterate it) and then insert the value to the table. For example, [code=php] $array … ![]() | |
Re: [code=php]<?php if(isset($_POST['submit'])){ $name = $_POST['name']; $age = $_POST['age']; //insert into table } ?> <html> <body> <form name="test" method="post" action="samepage.php"> Name: <INPUT TYPE="text" NAME="name" value="<?php echo $name ?>"><br /> Age: <input type="text" name="age" value="<?php echo $age ?>"><br /> <INPUT TYPE="submit" name="submit" value="submit"> </form> </body> </html>[/code] This is just an example program. … | |
Re: I have not checked your query. But this will work. [code=php] $query="select * from table where date_column between "2001-01-05" and "2001-01-10";[/code] This will print all the records where the date_column value lies between the first date and the second date. ![]() | |
Re: Order by multiple columns work this way. For example, you have 4 records. [quote] field1 | field2 | field3 | field4 -------+-------+--------+---------- 1 | 1 | 2 | 4 ------------------------------------- 2 | 2 | 100 | 5 ------------------------------------- 3 | 2 | 1 | 3 ------------------------------------- 4 | 3 | … | |
Re: Huh.. Can you post your code ? (because I have never heard of this problem before!) | |
Re: [code=php] <?php $filename ="excelreport.csv"; $contents = "testdata1;testdata2;testdata3; \n"; header('Content-type: application/ms-excel'); header('Content-Disposition: attachment; filename='.$filename); echo $contents; ?> [/code] I had given a similar example in another thread. Well, csv or excel, the procedure is the same. ![]() | |
Re: maybe you should check previous posts. But anyway, when you submit a form(for example,form1.php), post all the variables to another page(form2.php), add those variables to another variable, say $message and use mail function to send the mail. More on mail function [url=http://in2.php.net/manual/en/function.mail.php]Here[/url]. | |
Re: [quote] $_FILES['uploadedfile']['name'] [/quote] Shouldn't this be $_FILES['photo']['name'] :) | |
Re: $user_id=$_POST['UserID']; $password=$_POST['Password']; $query="select * from Customer where UserID = '$user_id' and Password = '$password'"; echo $query; $result=mysql_query($query) or die(mysql_error()); Check what $query prints. Execute the same in phpmyadmin. oh, and please, next time you post your code, put it in [code] tags. | |
Re: Pretty simple. Fetch the data from the database and place it between <textarea> tags. Here is an example. [code=php] <?php if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Full featured example</title> <!-- TinyMCE --> <script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script> <script … | |
Re: Umm.. you are passing the id as a parameter. Why are you trying to assign the value of $id to t (in javascript function) ? [code=php] <html> <head> <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT"> <!-- function login(t) { alert(t); } --> </SCRIPT> </head> <body> <?php $id=$_GET['id']; print "<input type='button' name='button' value='button' onClick=login('$id')>"; ?> … | |
Re: In the php script, where is $username coming from ? Have a hidden variable in the upload form and pass the username. Check if that user already have a folder. If yes, copy the image, else, create a folder and copy it. What error are you getting ? | |
Re: :) I ran your script and I didn't get any error. Maybe you are getting the error because there is no space after [quote]if(!isset($_SESSION['captcha'])){session_register('captcha');}[/quote] Replace this line by this. [code=php]if(!isset($_SESSION['captcha'])){ session_register('captcha'); } [/code] Cheers, Naveen | |
Re: [QUOTE=rm_daniweb;839629][COLOR="red"][B]REMEMBER! i am not the one who started to use nasty words! But if I am triggered I will play hard ball. [U] First you told me that you are wasting your time the other guy told me that I am ignorant.[/U] In the real sense if you are really … | |
Re: Clear @ before mysql_query and see if it throws any error. Also, you can have [code] $result = mysql_query($query) or die(mysql_error()); [/code] to print the error when the query fails. P.S. @ suppresses the errors, so you shouldn't use it in testing scenarios. That will make your life hard to … | |
Re: [url=http://www.youtube.com/watch?v=Gofox7Wgry8]Smells like teen spirit - Clarinet and hanging drums [/url] version. \m/ | |
Re: Someone had asked the same question [url=http://www.daniweb.com/forums/post497844.html]here.[/url] | |
Re: Its easier if you use javascript for this. Check these links. [url]http://www.javascriptkit.com/script/script2/timestamp.shtml[/url] or [url]http://www.javascriptkit.com/script/script2/tengcalendar.shtml[/url] Its simple to use. Call the javascript function wherever you want! | |
Re: line 34. I think thats a comment missing "//" | |
Re: If you have any <?php ?> tags in your script, you have to save it with the extension .php . If you want to save it with .html extension, then you need to modify your htaccess file. You can make use of only 1 page/script to do everything. -- list … | |
Re: Possible. Here is an example. [code=php] <html> <body> <form method="post" name="form"> <input type="submit" name="submit" value="page1" onclick="form.action='page1.php';"> <input type="submit" name="submit" value="page2" onclick="form.action='page2.php';"> </form> </body> </html> [/code] | |
Re: VALUES ('$Vet_First', '$Vet_Middle:', <<< is $Vet_Middle and not $Vet_Middle: :) ![]() | |
Re: :) webman07, What trudge said is right. If you had posted your question in sql forum, I am sure, by now, someone would have answered your question. Anyway, When you buy a domain, I think they provide database with the domain. I don't think you can 'load' sql to your … | |
Re: Try this. [code=php] <html> <head> </head> <body> <?php print "<script type='text/javascript'>"; print "window.open('http://www.examples.com/page.html','new_window1','status=1,scrollbars=1,resizable=0,menu=no,width=320,height=220');"; print "</script>"; ?> </body> </html> [/code] | |
Re: [url]http://www.w3schools.com/php/php_mysql_select.asp[/url] Check this. Instead of echoing $row['FirstName'] and $row['LastName'] in the example, assign it to a variable and use it as the 'value' of the textbox. [icode]<input type="text" name="firstname" value="<?php echo $firstname; ?>"> [/icode] | |
Re: What is the error ? And, instead of [quote] $webspace === '200 mb' && $bandwith === '3000 mb' $payment === '£22.90 per year' [/quote] I would suggest you to use only numbers. For example, [quote] $webspace === '200' && $bandwith === '3000' && $payment === '22.90' [/quote] Also note that … ![]() | |
Re: Something like this ? [url]http://www.c6software.com/Products/PopBox/[/url] | |
Re: The error is because there is something wrong in your query. Print the query, execute it in mysql console or phpmyadmin. (Also post it here) :) | |
Re: [code=php] <?php // open database connection code and then my code as follows $sql="UPDATE bookings SET startdate ='$_POST[startdate]',enddate='$_POST[enddate]',adults='$_POST[adults]',children='$_POST[children]',roomtype='$_POST[roomtype]', requirements='$_POST[requirements]' WHERE bookingID = '$_POST[bookingID]'"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } print "Your booking ID ".$bookingID; echo " has been changed"; $result = mysql_query("SELECT * FROM bookings WHERE bookingID='".$_POST['bookingID']."'"); if(mysql_num_rows($result) … | |
Re: What's in your admin.php page ? Are you checking if the session is valid or it has expired ? The best way to completely destroy the session is to redirect the page after you destroy the session. When the user clicks on the logout link, I do it this way. … | |
Re: [url]http://in.php.net/mysql_select_db[/url] Read the comments, especially of buzz at oska dot com :) |
The End.