-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
I was under the impression your script was already working to a certain degree; that is, you're getting some of the names you want, but not all...so...where is your mysql_query?
-
well you can check if it exists before running it and either assign a default id number or not run it at all...
-
hmm try putting backticks around `Date` and `table` in your query. Date and table are mysql reserved words. You can use them if you put backticks around them...though it's bad practice to use reserved words like that...
-
gonna assume it's used as a controller or switch
-
except for the fact that you didn't wrap your date/time formats in quotes, your script gave me -125 minutes $Date = "2008-07-26 14:50:58"; $Now = "2008-07-26 16:55:58";
-
well that's why i put "more" in parentheses.
-
Also, you need to replace studentnamecolumnhere and tablenamehere with your real column and table name... and I assume that you aren't showing your whole code, because I don't see anywhere where you're actually displaying any info (or even executing the query)
-
maybe you should sit down and rethink the whole having it twice in your table in the first place? But anyways, google "mysql distinct" and/or "mysql group by" one or both of those is what you are looking for.
-
so...even though your query works fine and you're getting your desired results, you somehow think the problem is with your query string? If those sql errors were real, I assure you, you wouldn't be getting your desired results and things would not be working fine. Therefore, either your problem is your error reporting system, or else possibly you have some erroneous call(s) to that function, include(s), etc.. or w/e, where vars aren't being set, etc... in addition to your normal calls where the vars are set, etc... that could cause you to have errors and yet at the same time, have results. Because I promise you, if there's an error in your syntax, you don't get a result source returned. You get a false.
-
no, $name does not have to be hardcoded as chris. I was giving an example variable so I could show how it's used in the query string. You can do whatever you want to to assign something to $name. p.s.- You should be using method="post" in your form and $_POST['name']. It's (more) secure.
-
no, time stamps are integers of the date in seconds since the unix epoch. That's just a format. What you want to do is use strtotime() to get the timestamp from your formatted times and then use some basic math. Subtract one from the other, and you got the difference in seconds. Divide that by 60, and you have the difference in minutes, etc...
-
simple math...timestamp is in seconds. 60 seconds in a minute, 60 minutes in an hour... $x = 100000; $y = 90000; $z = $x - $y; // 10000 $hours = $z / 60 / 60;
-
If it's doing what it's supposed to be doing but giving you those errors, maybe there is a problem with your error reporting system?
-
I'm just curious: if you don't want the user to access that page without going through index.php first, why not just make your header location index.php?
-
well first off I would make a one-time-only script to pull the "names" out, separate the first from the last names, and store them in separate columns. But anyways... $name = "chris"; $sql = "SELECT studentnamecolumnhere FROM tablenamehere WHERE studentnamecolumnhere LIKE '%$name%'";
-
Good luck selling templates... there are hundreds and thousands of free templates out there for those who don't know how to or don't care to just make their own design. You would be better off selling your services as a freelancer doing custom site designs.
-
you might wanna possibly do array_values() on your final array to reset the array keys.
-
[SOLVED] help me plan my "comments" organization
.josh replied to Lodius2000's topic in PHP Coding Help
no more speedy than ordering by anything else, AFAIK... but I'm nowhere near the database expert. You might wanna pose that question over in the sql forums. -
I cant figure out why: LOOK AT THIS POST OR I KILL A RUBBER DUCKY!
.josh replied to Dethman's topic in PHP Coding Help
I think your problem is that $pageNum is not being assigned or passed inside or to the function. This is making your offset -8 which there's no such thing. -
[SOLVED] help me plan my "comments" organization
.josh replied to Lodius2000's topic in PHP Coding Help
I think I would possibly do a one-to-many relationship. Basically you have 2 tables, one for the blog and one for the comments. The blog table is pretty straight forward, and so is the comment table, except for one thing: comment_info also has a blog_id column. this column will contain the id associated to the blog entry in blog_info. You would then run a query based on that. blog_info comment_info blog_id <---> blog_id blog_title comment_id blog_time comment_time blog_author comment_author blog_content comment_content -
perhaps $_COOKIE["tunk_portal"] doesn't exist? Perhaps you do not have cookies enabled on the client?
-
hard to find java hosting unless you get a dedicated server. That's more money.
-
sessions and passing values through hidden fields are both a form of data persistence but they are two different things. I would not suggest using hidden fields at all, as it is not in any way secure. A session var is used like this: page1.php <?php // need this to tell php that you have a session session_start(); // session variable $_SESSION['username'] = "mister_littlejeans"; // example to go to next page. can use a header or a form target instead echo "<a href = 'page2.php'>page2</a>"; ?> page2.php <?php // yes, you need this on every page you wish to use session vars on session_start(); // example use: echo out var echo $_SESSION['username']; ?>
-
HOw about a PHP security section?
.josh replied to willpower's topic in PHPFreaks.com Website Feedback
well damn..I guess I just read it wrong. Maybe I'm losing it... -
For web development? PHP ftw hands down. Java is better for graphical applications and other general stand alone applications. I guess it depends on what it is your doing (you really didn't mention that, so it's kind of hard to give you specific reasons).