Jump to content

Greaser9780

Members
  • Posts

    326
  • Joined

  • Last visited

    Never

Everything posted by Greaser9780

  1. Statement works like this: while ($list = mysql_fetch_array($res)) { echo "{$list['clan_name']} "; } ? is how do I use $list to display multiplefields
  2. Figured it out by searching previous posts.TY though. Maybe you could help me with something else. Now I am trying to SELECT multiple things from the same query and list them the same way. I tried the following but got nowhere: $sql="SELECT (`clan_name`,`wins`,`losses`) FROM `bhdsingle` ORDER BY `wins` DESC"; $res=mysql_query($sql) or die(mysqll_error()); while ($list = mysql_fetch_array($res)) { echo "{$list['clan_name']}{$list['wins']}{$list['losses']} "; }
  3. I am try to display data from my table in order of which clan has the most wins. Here is my code: $sql="SELECT `clan_name` FROM `bhdsingle` ORDER BY `wins`"; $res=mysql_query($sql) or die(mysqll_error()); while ($list = mysql_fetch_array($res)) { echo "{$list['clan_name']} <br>"; } It set up a list but puts least wins first. What else can I use? ORDER BY DESCENDING `wins`?
  4. Well I started developing a gaming site since I am or was very into games a couple months ago. Recently I found myself enjoying the site design and php/mysql more so than the games.Site will probably just be used for gaining experience with coding and what not. Currently I only have 2 tables set up in my db. 1 is for users as they register into my site and the 2nd is a table I sat up for my first game ladder which holds things such as wins,losses,clan name, id, last battle, player names and so on. Seeing as how I am getting more in depth, rather than just creating a few simple scrips I believe it is time for me to pick up a book or three. TY for the insight.
  5. Since clans will have multiple members use the leaders id that registered it?
  6. I want to create a script in php so that when someone registers a new clan it will automatically create a page where they can see there stats and update their clan information.I have no clue what to use in order to create a new file. Even if I could, how would the new file be stored? In my file manager or db? I appreciate any feedback.
  7. What if you use the php in your logout to destroy the session if they hit the submit button when you ask if they are sure they want to logout. Then they will have to log back in to start a new session. They can still do it from the same browser but they will have to log in again.
  8. Like this: array_pop($_POST); if ( get_magic_quotes_gpc() ) { $_POST= array_map('stripslashes', $_POST); } $clan_name = mysql_real_escape_string(trim($_POST['clan_name']));
  9. Should you add slashes to a variable everytime you are going to place it in a db?
  10. Maybe it's because I'm fairly new, but I am wondering why you are using 3 different db's when you could just create 3 different tables on 1 db. Then you wouldn't need 3 different database connections in one script.
  11. $query = "INSERT INTO `blog_entries` (blog_id, title, entry, date_entered) VALUES (0, '{$_POST['title']}', '{$_POST['entry']}', NOW())";
  12. U don't need the single quotes around you row identifiers.Try changing: ('blog_id', 'title', 'entry', 'date_entered') to: (blog_id, title, entry, date_entered)
  13. Always b4 or after the single quote,',
  14. As said previously, you forgot a comma. You have: "INSERT INTO blog_entries (blog_id, title, entry, date_entered) VALUES (0, '{$_POST['title']}' '{$_POST['entry']}', NOW())"; Change to : "INSERT INTO blog_entries (blog_id, title, entry, date_entered) VALUES (0, '{$_POST['title']}',<--------note the added comma! '{$_POST['entry']}', NOW())";
  15. Never seen smf files do you use html in it?
  16. It might be that when you click the link and goto the main forum page, there is no session start at the top of that file. If it isn't there, it won't let you continue your sessions.
  17. Since your $message file is php you can use html in that file. If your not that familiar with html the following code is what you will need to display that picture: <img src="Action" width="width_in_pixels" height="height_in_pixels"> Where it says action you need to input the location that you picture is located such as "yoursitename.com/images" Then all you need to do is place the code I gave you wherever you want the picture to be in your $message file--possibly the header since you said at the top.
  18. If anyone cares I finally figured it out.The following is what actually worked: $sql_select = "SELECT `clan_name` FROM `bhdsingle` WHERE `clan_name`='$clan_name' "; $result= mysql_query($sql_select) or die(mysql_error()); if (mysql_num_rows($result) == 1 ) { echo "Sorry, that clan name is already registered here at PST. Please choose another clan name."; include("bhdsingle_join_form.html"); } else { $sql = "INSERT INTO `bhdsingle` (clan_name, logo, message, email, aim, yahoo, msn, signup_date) VALUES('$clan_name', '$logo', '$message', '$email', '$aim', '$yahoo', '$msn', now() )" or die (mysql_error()); $sql_result=mysql_query($sql)or die(mysql_error()); echo "Congratulations on registering your new clan for the BHD Singles Ladder!"; } :) :)
  19. I'm pretty new as well. I just remembered it from a problem I had last week. Glad I could be of some help though.
  20. Well if you truly don't care about having a timestamp for anyhting in your db table why not just use phpmyadmin to go into your table and delete the row that stores the timestamp information?
  21. I take it that $message_choice is the actual body that you are sending to the people via e-mail? If this is true why not just include the picture at the top of your $message_choice file?
  22. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <form action="bhdsingle_create.php" method="post"> Clan Name:<input type="text" name="clan_name"> Logo:<input type="text" name="logo"> Message:<input type="text" name="message"> Email:<input tupe="text" name="email"> AIM Handle:<input type="text" name="aim"> Yahoo Handle:<input type="text" name="yahoo"> MSN Handle:<input type="text" name="msn"> <button type="submit">Submit</button> </form> </body> </html>
  23. Try changing this line: $result = mysql_query("UPDATE products SET pPrice=$prodPrice, pInStock=$prodQuant WHERE pID=$prodId"); To this: $result = mysql_query("UPDATE `products` SET `pPrice`='$prodPrice', `pInStock`='$prodQuant' WHERE `pID`='$prodId' ");
  24. I put the table back the way it was. Which is the way you suggested. And when I try changing the code to your most recent attempt it turns the screen all white. No clue what that means. It seems as if there is an error with it selecting the info and comparing because when it actually completes the page it skips right over the echo that it should be stating
×
×
  • 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.