Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. yeah..that's cool an all...but that has nothing to do with phpmyadmin...much less ERD through phpmyadmin
  2. in theory..no postulate..no. just....no This function $myVariable = $_GET['myVal']; //The line above and the lines below are completely unconnected... //Now later on...you may say to yourself...."Hey $myVariable would fit very nicely where $theArgument is!" function getRandom($theArgument) { $random_number = rand(0, $theArgument); echo "$random_number"; // The quotes you have here are useless } like ANY function ... can take an argument. it can take an unlimited number of them. I doubt you're going to try to prove me wrong or find the documentation on the unlimited part of that statement because I'm not even sure...but I'm sure it's quite a bit...depending on the language Now...since we've given this function an argument at it's.....composition stage I'll call it...we have to CALL the function with the same number of arguments. so... since $myVariable has the stuff we need in it...we'll pass it to the function. getRandom($myVariable); poof!
  3. I forgot the percentage signs...but I still doubt it will work... doesn't hurt to try it anyway though SELECT * FROM product_table WHERE TRIM("-" FROM `product_name`) LIKE "%' . $keyword . '%''); it should work without them anyway...if that's all you have in that field. Did you try it in something like phpmyadmin or did you just change your php script
  4. yeah and in your script you are calling this $maxVal= $_REQUEST['maxValue']; notice how you are calling $_REQUEST['maxValue'] instead of $_REQUEST['maxVal'] not to pertinent, but nevertheless...the variable is in the URL and variables in a url are part of the GET variable scope..so....you should use the GET variable scope. There is also the POST variable scope but instead you are using the REQUEST variable scope...which isn't a bad thing...just bad practice..and bad learning...because REQUEST contains...both of them....and cookie short answer change $_REQUEST['maxValue'] to $_GET['maxVal'] or $_RESUEST['maxVal'] if you choose
  5. You can do all that but you can't check your phpinfo file?
  6. well for one... you are asking for $maxVal to equal $_REQUEST['maxValue'] better yet...you are asking for it to equal $_GET['maxValue'] This index doesn't exist..from what you've shown.. you should be getting an undefined index error. you need it to be $_REQUEST['maxVal'] That's the first catch. Secondly.. you should NEVER use your superglobals in a function anyway..by superglobals I mean things like $_REQUEST $_GET $_POST $_COOKIE $_SESSION $_FILES
  7. SELECT * FROM product_table WHERE TRIM("-" FROM `product_name`) LIKE "' . $keyword . '''); maybe?... untested
  8. Why don't you strip the hyphens BEFORE your run the query.. you know...run the query with an unhyphenated $keyword... EDIT-> ALSO please don't ask me how because there are at least 489 different ways to skin this cat.
  9. Well, despite the argument of whether or not PHP and HTML are of the same genre... which they are not I'm sure we all understand your rant. There isn't much can be done about these people other than either ignore them or to just refer them to a good tutorial, which they probably won't even read. It's already been said before but a good little percentage of the users here just dump their question(s) here .. in the most popular board...which is conveniently on the top..and hope to god they get a quick answer. They don't care if they know the difference between HTML, PHP, ASP, SQL or even PCP. Don't believe me? Take ya a quick gander throughout the 'most popular' board...and you tell me, if they all haven't been moved already. Hypertext Markup Language This is a pretty ridiculous argument. In my thoughts, like was mentioned already...I need to be able to use logic in order for me to consider it a language. Something like if(something is important) { // that something is bold } else { // that something is not bold } In the Pre-PHP era...I would have used something like Javascript (a Client-Side Language, because...well...that's probably all I would have known been able to use back then. If not then I could have taken classes (if I were old enough) or read books on Perl or CGI (which are Server Side Languages). Whatever the language may be...they all did the same thing..(if you used it for the same thing) prewriting HTML. Whether you use a loop, a database connection, mathematics, variables, calculus, trigonometry, etc, etc...you're just going to print out an HTML tag with the answer. The main difference in PHP (or any programmming language) and HTML is that in HTML you won't get any parse errors, notice errors, fatal errors, any kind of script errors. It either works or it doesn't and THAT all depends on your browser. The worst case scenario is that your page looks horrible.
  10. seriously, what does your code look like
  11. well try Script_name or use the same one and enclose it with basename basename($_SERVER['SCRIPT_FILENAME'])
  12. straight from the manual http://us2.php.net/manual/en/reserved.variables.server.php echo " " .$_SERVER['REMOTE_HOST'] ." REMOTE_HOST "; echo " " .$_SERVER['REMOTE_PORT'] ." REMOTE_PORT "; echo " " .$_SERVER['SCRIPT_FILENAME'] ." SCRIPT_FILENAME "; echo " " .$_SERVER['SERVER_ADMIN'] ." SERVER_ADMIN "; echo " " .$_SERVER['SERVER_PORT'] ." SERVER_PORT "; echo " " .$_SERVER['SERVER_SIGNATURE'] ." SERVER_SIGNATURE "; echo " " .$_SERVER['PATH_TRANSLATED'] ." PATH_TRANSLATED "; echo " " .$_SERVER['SCRIPT_NAME'] ." SCRIPT_NAME "; echo " " .$_SERVER['REQUEST_URI'] ." REQUEST_URI ";
  13. in the end...it all really depends on who has more money and who has more proof and documentation on the matter... and also the better lawyers, which goes with more money. Imagine Person B was Donald Trump and Person A was Tim Palmer from down the road. My bet is that person B will win. On the other hand...if Person A is Donald Trump..well...you get my point The proper logical way to do this procedure in the first place would be for Person B to flat out pay Person A for their work, but instead Person B would end up paying MORE to the legal system to make it his/hers
  14. Because if someone is asking about a custom built CMS then 8 or 9 times out of 10, they are talking about "tracing" it out from Joomla or Drupal or something else. That's why I said you have to get the word "CMS" out of your head. Yes, it is a content management system, but to you...it is really a bunch of scripts doing what you want it to do. one script after another, one database and one table at a time. If you do it correctly, the questions that you ask in a forum about your project will NEVER include the word CMS and ONLY the problem that is at hand and that is why I moved this thread to Miscellaneous. For instance...your problem may have something to do with extracting a certain row from a certain field with the certain variables...etc,etc.. using the $_GET variables, XSS injection jQuery integration the list could go on. it's just like building..... a building
  15. do it one module at a time. If this is for a portfolio of YOURs I definitely would keep away from commercial CMSs. Don't even think about the word "CMS." Look at other real estate websites and see what they do and don't do. What do you want yours to do? What don't you want? One thing at a time. Your portfolio won't look so appealing (for PHP/Web Design, etc) if you have a footer saying it was made by another company Hint: the login system is usually a good place to start.
  16. Theoretically, yes.. But realistically no. Joomla isn't the same as a self-paced video tutorial. Yes you can change all the CSS and HTML to suit your needs but there are quite a few files to be handled here.. I'm no Joomla/Drupal/phpNuke connoisseur/expert and I didn't learn PHP yesterday either. But you won't see me taking those programs apart anytime soon..unless there's good money involved.
  17. Yeah you sorta got the idea a post logging table..... The only difference in between what you're thinking and I'm thinking is I'm saying you need an everything log table. Every single action of every single user of every single second. If they click a topic to view it...then by god...update the activity log..it's not like the data isn't there to update it with....hell, put their IP and browser type in there too just for fun...maybe even their...operating system name and all other kinds of information that you don't care about. Then as you are printing out your posts...in your "post printing loop" as we'll call it....or function then we have to actually check this table to see if the post is there for this user ..... on viewing charges.. which you pointed out. if it is there...get the time in which it happened and the time the last post was made in that particular topic and compare the two. The winner gets a badge either way. EDIT: This forum has pretty much the same concept I'm sure and it has over 85K users....how many users do you plan on having?
  18. Yeah, back to this...you'd have one table for your basic activities for things view, edit, delete, etc, etc, on and on with permission and more elaborate stuff and then you'd have the actions table that links to it...or it links to that.. so when user 4896 views post 458345 at 3:30PM yada yada.... it is logged so in the function you query SELECT a.datetime, b.lastpost_date FROM activity a, actions INNER JOIN forums_topics b ON a.post = b.postID WHERE a.post = 458345 AND a.actionID = whatever"view"is no guarentees at all on this code...it's all ficticious really... Now at this point you have both the time the user last viewed this topic AND the last time ANYONE posted to this thread. Then you'll do the greater than or less than idea you had in mind at the beginning and the rest is pretty logical. Well..it seems that way...but when you begin to code it...you'll get the parse errors..
  19. post your forum_topics schema do SHOW forum_topics in phpmyadmin or something
  20. and you want to put the read/unread icon/emblem/text in between which two user-defined functions? note the user-defined part.....because...uh...I have no clue what's going on there. short of the fancy insinuating naming
  21. There needs to be an activity table. For all users...Like an actions log.. things like view, edit, delete, etc, etc, that would store things like id | userId | actionId | postId | datetime | Now the complicated part ----- When you go to check if the post is read or unread you have to do your math based on a join of the activity table and the posts table...so lets see I'll have to get back to you on this one...I'm stumped on the coding part, but I got the idea down. EDIT What's the code you are using for displaying all the posts...
  22. bottom left of screen
  23. please don't start new topics for the same question...
  24. You want EVERY thread's original and recent!?? Now for just ONE thread... say thread 70 SELECT postId FROM posts ORDER BY dateTime DESC WHERE threadId = 70 and then do what I said from there
  25. well...for the most recent and the original post...all you'd do is order by the datetime after you have grouped them by the threadid....and walla...grab the top one for the original and last one for the most recent I think that's where you're headed.. what's the category have to do with it....I'd assume that is the forum itself? like the "3rd" forum category and such...but why would you search on forum categories when you already have the thread id. I would think you would just have a table full of ALL the threads no matter what category.. and put the category column in the thread table.
×
×
  • 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.