Forum: PHP 16 Days Ago |
| Replies: 4 Views: 261 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 24 Days Ago |
| Replies: 5 Views: 328 |
Forum: PHP 24 Days Ago |
| Replies: 5 Views: 328 This is wrong. Try,
$query = "SELECT * FROM Employee WHERE $method = '$search'";
$result = mysql_query($query); |
Forum: PHP 29 Days Ago |
| Replies: 14 Views: 681 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 29 Days Ago |
| Replies: 14 Views: 681 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 30 Days Ago |
| Replies: 2 Views: 268 The echo statement is incorrect.
echo "<a href=\"inventorid.php?inventorid=".$data2['inventorid']."\">".$data2['inventorid']." ".$data2['firstname']." ".$data2['lastname']."</a>\n";
is the... |
Forum: MySQL 30 Days Ago |
| Replies: 5 Views: 482 Congrats on solving your problem. I am glad you learnt something new :)
If you post your answer, even others may get to learn something from this thread. |
Forum: MySQL 30 Days Ago |
| Replies: 5 Views: 482 Seems like you didn't read the member rules. (http://www.daniweb.com/forums/faq.php?faq=daniweb_policies)
Ch, ch. Read more on count and group by clauses. After reading them, you will be able to... |
Forum: MySQL 30 Days Ago |
| Replies: 9 Views: 629 Dude, datatype as in int, varchar, date, datetime, etc.
ALTER TABLE clown_contest MODIFY COLUMN `location` varchar(40) AFTER `state`
Clear ? :) |
Forum: MySQL 31 Days Ago |
| Replies: 9 Views: 629 You forgot the datatype! (doh, even I forgot it in the syntax).
Sorry, here is the right syntax.
ALTER TABLE tablename MODIFY COLUMN columnname datatype AFTER columnname
This works for sure! |
Forum: PHP 31 Days Ago |
| Replies: 3 Views: 347 :) You forgot the column name as the 2nd parameter for mysql_result.
http://php.net/manual/en/function.mysql-result.php |
Forum: PHP 31 Days Ago |
| Replies: 5 Views: 308 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 31 Days Ago |
| Replies: 15 Views: 436 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 31 Days Ago |
| Replies: 5 Views: 308 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 31 Days Ago |
| Replies: 15 Views: 436 Or simply, $string = implode(",",$_POST['Prefered_Engineers']); |
Forum: PHP 32 Days Ago |
| Replies: 12 Views: 457 Hmm.. You are right! That makes sense.. |
Forum: PHP 32 Days Ago |
| Replies: 12 Views: 457 @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: MySQL 32 Days Ago |
| Replies: 9 Views: 629 Hey, sorry. I misunderstood the question.
/*
ALTER TABLE tablename MODIFY COLUMN columnname AFTER columnname
*/
Eg. ALTER TABLE members MODIFY COLUMN date_of_birth date AFTER username
... |
Forum: PHP 32 Days Ago |
| Replies: 12 Views: 457 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: MySQL 32 Days Ago |
| Replies: 9 Views: 629 Very simple.
ALTER TABLE tablename ADD columnname datatype AFTER columnname |
Forum: PHP 32 Days Ago |
| Replies: 4 Views: 266 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 32 Days Ago |
| Replies: 19 Views: 577 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 32 Days Ago |
| Replies: 19 Views: 577 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 33 Days Ago |
| Replies: 13 Views: 529 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: MySQL Nov 5th, 2009 |
| Replies: 4 Views: 536 Hi, can you elaborate your question ?
If you are inserting the value to the table from php, you can use substr (http://php.net/manual/en/function.substr.php) to insert only a part of a string. If... |
Forum: PHP Oct 6th, 2009 |
| Replies: 4 Views: 875 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: 265 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: 561 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: 617 :) Thanks for waking me up. That is absolutely right. |
Forum: PHP Aug 25th, 2009 |
| Replies: 19 Views: 617 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: 448 |
Forum: PHP Aug 25th, 2009 |
| Replies: 19 Views: 617 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: 448 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: 448 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: 617 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: 319 Ah! I see.. Happy learning :) Cheers! |
Forum: PHP Jul 29th, 2009 |
| Replies: 5 Views: 319 <label>Content: <textarea name="Content" /><?php echo $row['Content'];?></textarea></label><br />
Pretty simple ? eh ? :) |
Forum: PHP Jul 29th, 2009 |
| Replies: 12 Views: 1,247 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: Geeks' Lounge Jul 24th, 2009 |
| Replies: 22 Views: 1,138 Ah, It seems like you {haven't met/have no idea about} Daniweb's hardcore stalker with a never die attitude yet ? ;) |
Forum: Geeks' Lounge Jul 23rd, 2009 |
| Replies: 22 Views: 1,138 You must have worked with the wrong 'set' of people for that bad experience. This has never happened to me (I have been working for past 3 yrs).
Isn't the sentence in bold a good thing ? Who... |