Jump to content

Arbitus

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by Arbitus

  1. Hello everyone, I am creating a form where users submit information to go into a database. I want the users to be allowed to use both ' and " in their messages, but the problem is when I try to display what they have written, it will not show up on the page. How do I allow these characters?
  2. Ok, so I guess I found a solution. I added a new field called 'new' the the rows. if a code for a game that has never been entered is submited. it gets a 1 in new. other than that it has a 0. Then I made it so on the game list it only selects games with a 1 in new. Thanks for all your help. This is probably a hillbilly solution but if you can think of better either send me an email admin@arbituz.com or leave me a message here. Thanks agian!
  3. The only problem with this is that there will be more than just halo. If you look here: http://arbituz.com/cheat.php?system=x360 You will see what I'm saying. I would prefer to have each code to have it's own row to make user submissions to be easier. But everytime I add a new code, it shows the game name multiple times on the game list page.
  4. Well the problem is that if I limit to 1, it will not show all of the games. On this page it will have something like this: Call of duty 4 Call of duty WOW Halo But right now it looks like this: Call of duty 4 Call of duty 4 Call of duty 4 Call of duty 4 Call of duty WOW Call of duty WOW Halo Halo Halo Halo Halo Since there are rows for each cheat.
  5. So I'm creating a cheat code website. I have a table for each system x360 ps3 wii I want to be able to insert rows into each one that has individual cheats in per game. So say Halo has 10 codes, there would be 10 seperate rows for halo. Well this is all fine and dandy untill I try to make a page that displays the games. like so: <?php while($rows = mysql_fetch_array($query)) { ?> <center> <br> <a href="/game.php?system=<?php echo $system; ?>&game=<?php echo $rows['game_name']; ?>&id=<?php echo $rows['ID']; ?>"><?php echo $rows['game_name']; ?></a> </center> <?php } ?> When I do this, it displays each one seperatly so since i have 10 halo codes, it shows halo 10 times. So I guess what I'm trying to ask is if I can limit halo to be shown only one time on that page.
  6. Don't mean to double post and I'm sorry, But I'm still having trouble
  7. So I'm working on this forum and I got stuck again. I'm trying to do what (pretty much all forums do) and have it so their are categorys, and under the categorys their are boards -category --Board --Board -category --board You get the picture. So anyways, I'm having a hard time figuring out how to make it so the right boards show under the right category. This is the little clutter I have so far. I'm sure it makes no sense, and I know it would not work. But maybe you guys can show me how to modify it to work. while($catrows = mysql_fetch_array($catquery)) { ?> <table width="100%" border="0"> <tr> <td> <h3><?php echo $catname; ?></h3> </td> <tr> <td> <table width="100%" border="0"> <?php // Display our boards while($boardrows = mysql_fetch_array($boardquery)) { ?> <tr> <td width="8%" height="70"><div align="center"><?php echo $boardrows['img']; ?></div></td> <td width="50%"> <table width="100%" border="0"> <tr> <td><a href="viewboard.php?id=<?php echo $boardrows['ID']; ?>"><?php echo $boardrows['name']; ?></a></td> </tr> <tr> <td height="33"><?php echo $rows['boarddesc']; ?></td> </tr> </table> </td> <td width="10%"><div align="center">posts</div></td> <td width="18%"><div align="center">last poster</div></td> </tr> <?php } ?> </td> </tr> </table> </tr> </table> <?php } ?> Also, I have a cat_id field in my boards table. I just can't figure out how to make it so only the boards that are in category 1 show up in category 1 and the boards for category 2 only show up in the category 2 one. Sorry if I am confusing...I seem to do that a lot.
  8. I stumbled across MAX(ID) so I used that. Would it be better to use the mysql_insert_id() ? or is MAX(ID) alright. It seems to work beautifully
  9. I can't figure out how to use it, or store it's value in a variable so I can insert it into the next query. // This is the topic table $newtopicsql = "INSERT INTO `arbi_topics` (title,board_id,starter_id) VALUES ('$topictitle','$boardid','$username')" or die (mysql_error()); mysql_query($newtopicsql) or die (mysql_error()); //I need the ID of what I just entered able to be inserted here in topic_id $newpostsql = "INSERT INTO 'arbi_posts' (topic_id,topic_title,message,post_owner) VALUES ('$topicid2','$topictitle','$topicmessage','$username')" or die (mysql_error()); mysql_query($newpostsql) or die (mysql_error());
  10. So I'm working on this forum and I hit a problem. Right now I have 2 tables for posts and topics. I have a topics table which stores the board_id, topic_title, topic_owner, and of course, the topic ID itself. Then I have the posts table which also stores the topic_title, it's own id, users message and so on // Insert the information into arbi_topics first $newtopicsql = "INSERT INTO `arbi_topics` (title,board_id,starter_id) VALUES ('$topictitle','$boardid','$username')" or die (mysql_error()); mysql_query($newtopicsql) or die (mysql_error()); //Insert the information in arbi_posts second $newpostsql = "INSERT INTO 'arbi_posts' (topic_id,topic_title,message,post_owner) VALUES ('$newID','$topictitle','$topicmessage','$username')" or die (mysql_error()); In the first query, it is storing some information in the topic table. While the second query is storing the information in the posts table. Some how I need to get the ID from the topics table into a variable so I can store the topic ID into the posts table.
  11. Alright guys, I got another one for you. So I'm working on a section of this project where you select a gaming system (xbox 360 for example) and it shows all of the games that havee 'x360' in the database under the system field. $gamesql = "SELECT * FROM games WHERE system='$system' ORDER BY title ASC"; like this. Well the only problem now is, games like grand theft auto 4 that are for both xbox 360 and the PlayStation 3. With the piece of code I showed here, it is only looking for x360 for example in the field 'system'. What I am trying to ask is, what would be the best way for me to only have 1 table for games and I can pull grand theft auto from that table because it is for x360 at one point, then later on it will be able to pull that same table of grand theft auto because it is for PlayStation 3 also.
  12. haha alright thanks. And what about using radio buttons and dropdown boxes? I want the user to be able to pick an option from a dropdown box and when it is submited have it put in the database.
  13. The only restriction I think I want is that it cannot contain html or php
  14. I don't want people's username to be <input type="text" value="I have a weird username" /> when they are registering for a new account. sorry for not being specific
  15. How do I stop people from being able to use forms as their username or password? Also, how could I use drop down boxs or radio buttons in a form and insert the answer into a database?
  16. I'm trying to set up one of those cool things that has A-Z (each a link to that letter). I'm having trouble with matching the letter clicked and pulling all games that start with that letter from the database. <?php $letter = $_GET['letter']; $system = $_GET['system']; $sql = "SELECT * FROM OSG_Games WHERE system_id = $system ORDER BY title ASC"; $query = mysql_query($sql); while($row = mysql_fetch_array($query)) { echo $row['title']; echo "<br>"; } Don't really know what to do after this to make it so the echo'd title matches up with the letter picked.
  17. Thanks so much! Didn't even think of it that way
  18. I'm having problems with functions. This is my first time actualy using functions in a script so bare with me. How would I be able to create a functions.php, and in this file one of the functions created would check to see if the users session is active. Right now I'm trying this functions.php <?php //Functions.php! function session_check() { if(isset($_SESSION['admin_id'])) { ?> index2.php <?php include("../Sources/functions.php"); session_check(); echo "hello!"; } else { echo "no hello!"; } ?> I know I'm most likely doing something terrible here.
  19. One quick note. Make it so when you logout, its in the same browser. I got a logout note in a seperate browser window and it kept the other one running. Then you get a "Sorry this page doesn't exist yet. =\" when you keep trying to play. Would look better if you got a confirmation of the logout then were auto directed to main page. Doing great though. return home safely
  20. It's me again! haha just wanna say you guys are great. now for the question (which you guys are always able to answer lol) I'm displaying results from a database on a page. How would I make it so once it's pulled so many results say 10, it creates a new link on the bottom to page 2 which would start with the 11th result and so on. Sort of how a forum works. Once there are 10 replys, it creates a link to page 2 of the topic which shows the rest of the replys
  21. thanks guys. thought it was something a little more complicated. I think i tried something like that. didn't think it would know to aphebetize instead of sort the numbers.
  22. I can't figure out how to order the title of games when I select them out of the database and store them in an array. Database would look like Halo 3 Final Fantasy Alpha centari which i need displayed as Alpha Centari Final Fantasy Halo 3 please explain what is going on in code too (sort of oding this to learn more php)
  23. Thanks so much! Just tried the ucfirst() and worked perfectly! I'll try that too, thanks again.
×
×
  • 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.