Jump to content

HuggieBear

Members
  • Posts

    1,899
  • Joined

  • Last visited

Everything posted by HuggieBear

  1. Try this... [code] <?php php require("config.php"); $result = mysql_query("SELECT * FROM spell"); ?> <select name="wordlist"> <option value="1" selected>Select Word</option> <?php   while($row = mysql_fetch_array($result)){       echo "<option value=\"$row['words']\">$row['words']</option>\n";   } ?> </select> [/code] Regards Rich [color=red]Edit: Damn it, why are my chubby digits sooooo slow at typing[/color]
  2. Maybe I'm missing something here, but shouldn't this... [code] `first_name`='$first_name', `maiden_name`='$maiden_name', `last_name`='$last_name', etc... etc... [/code] Be like this... [code] `first_name`='$strfirst_name', `maiden_name`='$strmaiden_name', `last_name`='$strlast_name', etc... etc... [/code] You've missed off the 'str' at the beginning of the variable name. Regards Rich
  3. [url=http://www.php.net/manual/en/function.nl2br.php]nl2br()[/url] is clearly where it's at.... Regards Rich edit: Ooops, too slow!
  4. I have no idea why there's two <form> elements here. bskauge, why do you think you have a need for two seperate forms? Regards Rich
  5. shocker-z, I think that's the only way you can do it.  Unless you have your original details secured. I always add items to the DB, pass the session ID and then retrieve from the DB once secure. Regards Rich
  6. Your form looks fine, so long as you changed the previous line as suggested. Make this your test.php code (copy and paste it if you have to): [code] <?php   $user = $_GET['user'];   $address = $_GET['address']; ?> <html> <head>   <title>Title here!</title> </head> <body>   <pre>   Welcome : <?php echo $user; ?><br>   Your address is : <?php echo $address; ?>   </pre> </body> </html> [/code] If this doesn't work, perhaps you could tell us what IS happening.  Do you definitely have PHP installed.  If you create a page called info.php and code it like this... [code] <?php phpinfo(); ?> [/code] Do you get a full PHP output? Regards Rich
  7. I'd have thought you were better off with a Regular Expression for this... Check out preg_match() in the [url=http://www.php.net/manual/en/function.preg-match.php]PHP Documentation[/url] Regards Rich
  8. Try this, change the <form> tag on your HTML page to this: [code]<form action="test.php" method="get">[/code] Then change your variable names in test.php to this... [code]echo "welcome  :$_GET['user'] <br>";[/code] Regards Rich
  9. Give that a try... [code=php:0] <?php if (!isset($_GET['ModelSelect'])){   $ModelSelect = "model"; } ?> [/code] Rich
  10. Beat me to it  :( I had the comma missing from my statement when testing it and couldn't figure out why this wasn't working... [code] INSERT into tableName (start_date, end_date) VALUES (now(), DATE_ADD(now() INTERVAL 1 YEAR)); [/code] Well done Obs.
  11. OK, this can be one of two ways, you can manipulate the date in PHP first, or when you insert it into the database. I'm assuming you're using MySQL? Rich
  12. Is the field type 'datetime'? Rich
  13. Just now() without the quotes... [code] $sql="INSERT into table_name (col1, col2, col3) VALUES ("data1", "data2", now())"; [/code] Regards Rich
  14. Not if you included that code on the controlpanel.html file too. Give it a .php extension and away you go! Rich
  15. Nope, I don't think so, you'll just have to resort to good old <ALT>+<TAB>. Rich
  16. You could use a javascript onClick() event to submit the form. Something like... [code] <a href="javascript:void(0)" onclick="document.forms.formName.submit()">xxx</a> [/code] Regards Rich
  17. mcmuney, Did this help you at all? Regards Rich
  18. There's no HTML variables. To put it into an PHP variable then just assign it... [code=php:0] <?php $today = date("Y-m-d"); echo "Today's server date is $today"; ?> [/code] Regards Rich
  19. [quote] Is there a list of the functions like the php ones on phpfreaks.com [/quote] I just went to the [url=http://dev.mysql.com/doc/refman/5.0/en/]MySQL site[/url].
  20. If that looks odd, which it may if there's formatting code in SSI.php then you could always edit the function ssi_recentPosts() in SSI.php That's the beauty of PHP, you can hack around with it and there's always someone to help when it goes wrong  ;) Rich
  21. [quote] one more thing, before i leave u alone, lol, if say i use month(), obviously it prints out 9 as the numeric month, but how can i print out September instead [/quote] Try monthname() instead of month() Rich
  22. Glad it worked, taught myself something new there too.  I'm used to working in Oracle, so I took the following oracle code... [code] SELECT to_char(date_column, 'YYYY') "Date", count(*) "Count" FROM table_name GROUP BY to_char(date_column, 'YYYY') ORDER BY "Date" DESC [/code] ... and then worked out what the equivalent functions were in MySQL. I've posted this here for anyone who comes across your post and wonders how to do it in Oracle. Rich
  23. OK, give this a try... [code] SELECT year(date_column), count(*) FROM table_name GROUP BY year(date_column) [/code] Regards Rich
  24. OK, it shouldn't be too hard... What datatype is your date column?  Date, Timestamp, Datetime? Rich
  25. What database are you using?  MySQL, Oracle, MSSQL? Rich
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.