Forum: PHP 21 Days Ago |
| Replies: 4 Views: 299 Pass $row['date'] as a parameter to this date function and return the changed value.
Eg.
function changeDate($date) {
$newdate = date('d/n/y',strtotime($date));
return $newdate;
}
Call... |
Forum: PHP 28 Days Ago |
| Replies: 5 Views: 347 |
Forum: PHP 28 Days Ago |
| Replies: 5 Views: 347 This is wrong. Try,
$query = "SELECT * FROM Employee WHERE $method = '$search'";
$result = mysql_query($query); |
Forum: PHP 33 Days Ago |
| Replies: 14 Views: 696 The only problem with this is , if a user loses his interest midway [ie., after submitting 1st form], there will be a obsolete record in the table. Or else, this is good. |
Forum: PHP 33 Days Ago |
| Replies: 14 Views: 696 You can do it in 2 simple ways (maybe there are even more, but I am not aware of it).
You can either save the data of the first form in session after it is posted, and then, when the second form is... |
Forum: PHP 34 Days Ago |
| Replies: 2 Views: 287 The echo statement is incorrect.
echo "<a href=\"inventorid.php?inventorid=".$data2['inventorid']."\">".$data2['inventorid']." ".$data2['firstname']." ".$data2['lastname']."</a>\n";
is the... |
Forum: PHP Nov 18th, 2009 |
| Replies: 3 Views: 368 :) You forgot the column name as the 2nd parameter for mysql_result.
http://php.net/manual/en/function.mysql-result.php |
Forum: PHP Nov 18th, 2009 |
| Replies: 5 Views: 331 Condition is a mysql reserved keyword. In order to use it, you have to use ` [don't confuse it for single quote]. ie., `condition`. In my opinion, use some other word instead of condition to avoid... |
Forum: PHP Nov 18th, 2009 |
| Replies: 15 Views: 450 Yeah, ofcourse. :) $string is just a variable name. You can give any name to a variable.
See Php naming convention here (http://www.tizag.com/phpT/variable.php). |
Forum: PHP Nov 18th, 2009 |
| Replies: 5 Views: 331 Clear @ before mysql_query and see if it throws any error. Also, you can have $result = mysql_query($query) or die(mysql_error()); to print the error when the query fails.
P.S. @ suppresses the... |
Forum: PHP Nov 18th, 2009 |
| Replies: 15 Views: 450 Or simply, $string = implode(",",$_POST['Prefered_Engineers']); |
Forum: PHP Nov 18th, 2009 |
| Replies: 12 Views: 466 Hmm.. You are right! That makes sense.. |
Forum: PHP Nov 18th, 2009 |
| Replies: 12 Views: 466 @cwarn23, I think the OP was saying, that it shows only 1 record instead of 2 !
@levsha,
Are you sure you have 2 records for that query ? If you have 2 records, it *should* display them. There is... |
Forum: PHP Nov 17th, 2009 |
| Replies: 12 Views: 466 You are supposed to put mysql_fetch_array in a while loop.
while( $data2 = mysql_fetch_array($query)) {
echo $data2['firstname'];
echo $data2['lastname'];
echo $data2['task'];
} |
Forum: PHP Nov 17th, 2009 |
| Replies: 4 Views: 271 I don't recommend using mysql_fetch_row though. This will return an array with numeric indices and the script will fail if you add a new column to your table.
I personally prefer using... |
Forum: PHP Nov 17th, 2009 |
| Replies: 19 Views: 590 Probably you didn't get my point. I was trying to demonstrate the use of exit after header function. Even though it will throw an error, it will still print This data is supposed to be secure... .... |
Forum: PHP Nov 17th, 2009 |
| Replies: 19 Views: 590 The exit function is used as a safety measure just in case the end user gets to echo something before header function (that will cause an error and header will not redirect).
Here is an example,
... |
Forum: PHP Nov 16th, 2009 |
| Replies: 13 Views: 536 There are still some typos. $GET_['formfield'] instead of $_GET['formfield']. One simple suggestion though. You don't need a switch/if-elseif-else condition to find out the day. A simple array will... |
Forum: PHP Oct 6th, 2009 |
| Replies: 4 Views: 889 Pretty simple. Fetch the data from the database and place it between <textarea> tags. Here is an example.
<?php
if(isset($_POST['save'])) {
print "<pre>";
print_r($_POST);
print "</pre>";... |
Forum: PHP Oct 5th, 2009 |
| Replies: 5 Views: 274 Instead of storing the password just like a normal string, save it as an encrypted string, using SHA1 or something. This will provide you more security as well as solves your issue.
Here is an... |
Forum: PHP Aug 25th, 2009 |
| Replies: 4 Views: 582 What is the problem ? You would be selecting CourseName and courseID. So, when you post the form, You will have "MATHS" in $_POST['CourseName'] and "101" in $_POST['courseID']. Then it is all about... |
Forum: PHP Aug 25th, 2009 |
| Replies: 19 Views: 624 :) Thanks for waking me up. That is absolutely right. |
Forum: PHP Aug 25th, 2009 |
| Replies: 19 Views: 624 Can you post your code ? (and print the variable $sql and post it here ?)
I guess the variable $table is empty or something. |
Forum: PHP Aug 25th, 2009 |
| Replies: 6 Views: 452 |
Forum: PHP Aug 25th, 2009 |
| Replies: 19 Views: 624 Are you using Linux server ? If yes, then make sure to check the case (lowercase/uppercase) of table and column names. Linux is case-sensitive. :)
Did you try printing out the query and executing... |
Forum: PHP Aug 25th, 2009 |
| Replies: 6 Views: 452 Hmm.. I tried your code snippet and it worked fine. There is one thing that I'd always do after having a header, an exit. This might or might not fix the problem, but try having an exit after... |
Forum: PHP Aug 25th, 2009 |
| Replies: 6 Views: 452 Try <?php ob_start(); ?> to turn on output buffering (should be the 1st line of your code) and <?php ob_flush(); ?> as the last line to flush the buffered output. |
Forum: PHP Aug 25th, 2009 |
| Replies: 19 Views: 624 1. Do you have mysql_connect ?
2. Are you selecting the database ?
3. Does that table exist ?
4. Are you sure the query is correct ? Ie., echo the query and test it in phpmyadmin/mysql console. ... |
Forum: PHP Jul 29th, 2009 |
| Replies: 5 Views: 320 Ah! I see.. Happy learning :) Cheers! |
Forum: PHP Jul 29th, 2009 |
| Replies: 5 Views: 320 <label>Content: <textarea name="Content" /><?php echo $row['Content'];?></textarea></label><br />
Pretty simple ? eh ? :) |
Forum: PHP Jul 29th, 2009 |
| Replies: 12 Views: 1,266 http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php
You should use the array returned by mysql_fetch_array and not the result resource itself. ie., $row['content'], $row['name'] etc and not... |
Forum: PHP May 22nd, 2009 |
| Replies: 4 Views: 250 Read this FAQ. (http://www.daniweb.com/forums/thread191031.html) |
Forum: PHP May 22nd, 2009 |
| Replies: 2 Views: 364 mysql_num_rows (http://in2.php.net/mysql_num_rows) will tell you how many records were returned by the query. |
Forum: PHP May 22nd, 2009 |
| Replies: 14 Views: 682 Which query are you exactly using ? Because, earlier you had posted
//wrong query, quotes are all mixed up
$query = 'SELECT * FROM t_master_reg dt_reg_reminder >= '$today' AND dt_reg_end... |
Forum: PHP May 21st, 2009 |
| Replies: 14 Views: 682 Did you print the query and execute it in mysql console or phpmyadmin ? Does that return any records ?
If Yes, then it should work in this case too.
If No, then you don't have any records in the... |
Forum: PHP Apr 25th, 2009 |
| Replies: 4 Views: 1,440 Print out the query, execute it in phpmyadmin, Or, simply add, or die(mysql_error());
ie.,
// sent from form
$textbox_value = ($_POST['code']);
$checkbox = ($_POST['checkbox']);... |
Forum: PHP Apr 24th, 2009 |
| Replies: 5 Views: 362 I don't get it ! If you have the entire address in the table, why not simply use,
echo "<img src='".$row['image']."'>"; ? |
Forum: PHP Apr 24th, 2009 |
| Replies: 5 Views: 362 What does $row['image'] print ? If you are in the subdirectory and if you want to print an image in the main directory, use .. .
ie., ../imagename.jpg |
Forum: PHP Apr 24th, 2009 |
| Replies: 4 Views: 1,440 Instead of having different names for your checkboxes, use a checkbox array and on submit, loop through all the selected checkbox and insert a record to the table.
For eg.,
<form name="addcode"... |
Forum: PHP Apr 22nd, 2009 |
| Replies: 11 Views: 602 I checked your script.
is wrong. If you want to have a hidden element with php variable's value, you should do,
<input type="hidden" name="autoid" value="<?php echo $autoid; ?>">
Secondly,... |