Jump to content

arpowers

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by arpowers

  1. Hey guys, Quick question: I have an array that looks like this: $var = array( 'name' => 'thename', 'title' => 'thetitle', 'media' => 'themedia' ); and I need to move the 'name' index to the end. Like so: $var = array( 'title' => 'thetitle', 'media' => 'themedia', 'name' => 'thename' ); How do I do that?
  2. Hey everyone... So I've been trying to figure out an easier way of handling passed variables. Until now I have been simply using $_GET or $_POST and then sanitizing the result... I was looking through the PhpBB code and I noticed that they use a request_var(var, default..) function, to universally pass and sanitize their cookie, get and post variables... the only problem is that I think their code is a little bit dated (php4) does any one have or know of a simple method/function to simply, safely and universally do passed variable handing?? thanks in advance!!! ANDREW
  3. Hey guys, I'm creating a discussion board (forum) on my site... what is the best way of querying and ordering the posts (to sort by order of with last post per thread) since I'm using two tables, it seem a little counter-intuitive (or at least hard to do elegantly) Andrew
  4. Thanks for the replies... yes it makes more sense:) sorry I should have clarified, but what I was looking for was the 'threads and replies' ... I wasn't thinking about the table for forums and categories thanks again.>. Andrew
  5. Hey guys, quick question... is it better to have one db table or two in your design of forums? I can see advantages to both approaches.. Thanks Andrew
  6. Hey guys, I've just the finishing touches on the 'functional' part of a project, but I haven't really added validation to most of the forms.. what is the best way to add validation? (class, hand-code, pear, etc...) Thanks Andrew
  7. google home page or facebook layout:)
  8. Hey guys, whats the best way to store a page layout... meaning I have a bunch of independent elements that I want to load into a page, but I want to let the user control/maintain the order of said elements... how would I best keep track of this in a database? thanks ap
  9. Hey guys, I am working on a project where we would like to make it possible for users to save layouts and organize the flow of information on the APP. My question is: how is this best accomplished? Initial concepts that pop into mind are saving arrays or parent-child relationships, but I'm sure I'm missing something. has anybody come up with a nice solution to this? An example of what I'm looking for is how Facebook allows users to organize their profile... Thanks Andrew
  10. thanks for the reply.. sorry I was a little unclear on this.. I'm working with many-to-many relationships here among different user types.. that changes things quite a lot.
  11. hey everyone.. here is my question... when you are designing a relational database you have many different relations, is it better to assign a table to each 'type' of relation or to create a master relational table where all relations are defined. For example: rtbl_bananas_oranges rtbl_bananas_pears in contrast to: rtbl_relations.. containing the columns id(primarykey) .. object1_id.. object2_id then go into object_id table and see what type it is.. .... the reason I ask is it gets tedious to keep track of an objects ID as well as its type .. hopefully this makes sense, Im going crazy trying to figure out how to implement this.. Andrew
  12. hey~ I just want to hear some opinions on the best js framework to use with php! anything helps:) AP
  13. Hey guys, if a page loads in a certain amount of time on my proto server (on my macbook pro) .. will it load the same way under normal server loads ? does that make sense? mainly I want to know if I can profile on this machine... AP
  14. Hey guys! I am creating a messaging system where I add a message to the DB through $_POST data.. I'm wondering how I can prevent the data from being resubmitted if the user refreshes the page? any suggestions would be useful! as always, thanks in advance:) Andrew
  15. thanks.! another question... what about making sure that this thread has something to do with the user... i.e. what do you do to prevent somebody from inputting a number in the url and accessing somebody else's thread...
  16. Hey everyone, what are the security measures I should use when using $_GET values for page navigation and in queries? for instance in a messaging system... $thread_id = $_GET['id']; function GetMessage($thread_id){ $query = "SELECT msg_id, thread_id, from_id, from_type,... FROM tbl_mailbox_messages WHERE (thread_id ={$thread_id}.... (you get the idea) should I be running these values through a function to make sure their clean, or is something like this this already safe?
  17. Fantastic solution Toon~ ! I think you may have solved my problem... So to set the root you: set root to default to 0 and set root to the unique id of the true root for replies? I didn't think of the parent_id thing, i was planning on sorting by the timestamp.. is there a problem with that approach? thanks again!
  18. Hi! I'm trying to create a messaging system for a project I'm working on. Theoretically I only need one table to do this, but I do need a unique auto increment primary key 'id' and a thread_id column. The thread_id column will contain a unique value for new messages, and will contain referential values for thread replies (children).. What is the best way of accomplishing this or should I just create a thread table with just one column? Thanks!
  19. Hey! here is my problem.... I am writing a script that needs to pull all users from a relational table. I would like to return the total number of users affiliated in the table but I would also like to limit the array fetched to a suitable number to be displayed on the screen (say.. 6).. so if I use Code: $total_num = mysql_num_rows($result); while($row = mysql_fetch_array($result)){ //this will get data for every user... i don't want to do that. $data[] = $row; } so what I want from this one query is enough to get this info.. I want to: 1. get a total number of users affiliated (e.g. you have 22 users affiliated) 2. only output a certain lower number for output to page. (e.g. user1 - user2 - user3- user4 etc...) Thanks!~ Suggestions? Back to top View user's profile Send private message
×
×
  • 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.