Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. "0000-00-00" is the best format, but you can do it how you want. To format the date how you are wanting, you would do this $date = date("Y/m/d"); Now if you inserted $date into a DATE field in the database, I'm pretty sure it will come out the format you set it in.
  2. An ambulance for that?! I was bucked off a horse and snapped both bones in my forearm and didn't even get an ambulance. My dad got a piece of wood and taped it to my arm and I had to carry it all the way to the hospital.
  3. <?php if (isset($_POST['submit'])){ foreach ($_POST['delete'] as $id){ $query = "DELETE FROM person WHERE personID='$id'"; $result = mysql_query($query)or die(mysql_error()); } echo "Records Deleted<p>"; } $result = mysql_query("SELECT * FROM person"); echo "<form action='{$_SERVER['PHP_SELF']}' method='post'>"; while($row = mysql_fetch_array($result)){ echo "<input type='submit' name='delete[]' value='{$row['personID']}'> "; echo $row['FirstName'] . " " . $row['LastName']; echo "<br />"; } echo '<input type="submit" name="submit" value="Delete Records">'; echo '</form>'; ?> Wherever you see the row "personID" is where you need to replace that with whatever your unique ID is for that table.
  4. You include the file at the top of your script that your using the class in. include "myclass.class.php";
  5. Barand, just to let you know, there has been multiple double posts today. Someone earlier said they got an error and it posted the topic twice, so I don't think the posters are intentionally doing it.
  6. Why don't you just read the descriptions in the manual and see for yourself? http://us2.php.net/mysql_fetch_assoc http://us2.php.net/mysql_fetch_array
  7. Initializing your variables first will also speed up your script a little.
  8. Why did you post this twice? I replied on your last thread.
  9. You can select a random row in your query, so that will make it easier <?php $query = "SELECT username FROM lottery ORDER BY rand() LIMIT 1"; $result = mysql_query($query)or die(mysql_error()); $row = mysql_fetch_assoc($result); mysql_query("UPDATE players SET credits=credits+$prize WHERE user='{$row['username']}'"); ?>
  10. I used to be into online simulation games, and I would always be so curious on how every little thing worked. I finally got so curious that I started researching, and thats when I found PHP. Just from doing something very basic, yet dynamic, I would be completely amazed and got even more curious on how to do other things. So from that point on I was obsessive with it, I would always have a book or be reading online tutorials. I remember first coming to this forum and looking at the code some of you guys posted, and I was like "WTF! How do any of these people understand this stuff?!"...it literally looked like a bunch of jumbled letter and numbers that made no sense, hah.
  11. The header banner doesn't look very professional, looks like it was just slapped together quickly. The links are very small and don't really stand out much. Basically the site looks pretty bland, there is a lot more creativity that can go into it.
  12. This has nothing to do with PHP. The rollover would be javascript, and how to make an image would be photoshop related.
  13. And where exactly are the tracks?
  14. You register_globals setting was probably changed meaning your going to have to start defining your variables from forms actually using $_POST. So you would change lines like this $nsuser = stripslashes($user); To $nsuser = stripslashes($_POST['user']);
  15. Well, if that is the tracks name, then what do you expect it to do? Obviously it is going to order by the name, and not the track. Could you post your database table setup?
  16. That code doesn't make any sense. I'm not even sure what your trying to do. If the URL looks like this on the page you are on http:www.mysite.com/index.php?address=test%40testtt%2Ecom Then when you do this it will grab that information from the URL. $address = $_GET['address']; echo $address; //will print "test testtt Ecom" Now explain exactly what your trying to do. Your being to vague in your question to give you a better answer.
  17. You can get the address by doing this $address = $_GET['address']; As long as your URL contains that information, it will be able to be grabbed by the above code.
  18. Well, you are ordering by "productCode"...does that have something to do with the tracks? It's hard to help you without knowing the setup of your database.
  19. http://www.phpfreaks.com/forums/index.php/topic,95867.0.html
  20. I think the best solution is going to be a cookie. You don't have to include anything on every page and what not.
  21. All you have to do is this <?php if (!isset($_POST['field_name']) || $_POST['field_name'] == ""){ die("This field is required!"); } ?>
  22. Thanks for your input...but this thread is 2 months old, and has been solved. No need to bring it back from the dead =]
  23. So you want to keep the URL? echo '<form method="post" action="'.$_SERVER["REQUEST_URI"].'">';
×
×
  • 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.